Vik Paruchuri commited on
Commit
2b17801
·
1 Parent(s): ed75e8a

Better support for chunk format

Browse files
marker/scripts/server.py CHANGED
@@ -84,7 +84,9 @@ class CommonParams(BaseModel):
84
 
85
 
86
  async def _convert_pdf(params: CommonParams):
87
- assert params.output_format in ["markdown", "json", "html"], "Invalid output format"
 
 
88
  try:
89
  options = params.model_dump()
90
  config_parser = ConfigParser(options)
 
84
 
85
 
86
  async def _convert_pdf(params: CommonParams):
87
+ assert params.output_format in ["markdown", "json", "html", "chunks"], (
88
+ "Invalid output format"
89
+ )
90
  try:
91
  options = params.model_dump()
92
  config_parser = ConfigParser(options)
marker/scripts/streamlit_app.py CHANGED
@@ -94,7 +94,7 @@ page_range = st.sidebar.text_input(
94
  value=f"{page_number}-{page_number}",
95
  )
96
  output_format = st.sidebar.selectbox(
97
- "Output format", ["markdown", "json", "html"], index=0
98
  )
99
  run_marker = st.sidebar.button("Run Marker")
100
 
@@ -155,6 +155,8 @@ with col2:
155
  st.json(text)
156
  elif output_format == "html":
157
  st.html(text)
 
 
158
 
159
  if debug:
160
  with col1:
 
94
  value=f"{page_number}-{page_number}",
95
  )
96
  output_format = st.sidebar.selectbox(
97
+ "Output format", ["markdown", "json", "html", "chunks"], index=0
98
  )
99
  run_marker = st.sidebar.button("Run Marker")
100
 
 
155
  st.json(text)
156
  elif output_format == "html":
157
  st.html(text)
158
+ elif output_format == "chunks":
159
+ st.json(text)
160
 
161
  if debug:
162
  with col1: