MrFeelgoood commited on
Commit
a1404bc
1 Parent(s): 2e44a68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -203,15 +203,6 @@ def extractor_clean(text, k_words, transformer, question, total_kwords, return_t
203
  return values, return_text
204
 
205
 
206
- def format_output(extracted_values):
207
- output = {}
208
- values_output = "\n".join([f"mq. {value}" for value in extracted_values[0]])
209
- output["Mq. Values"] = values_output
210
- output["Total"] = extracted_values[1]
211
- if extracted_values[2]:
212
- output["Ref. Text"] = extracted_values[2]
213
- return output
214
-
215
 
216
  def pdf_ocr(file, model_t, question):
217
  # Convert PDF to image
@@ -296,7 +287,6 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
296
  extract_button.click(fn = ocr_interface,
297
  inputs=[pdf_input, model_input, question_input], outputs=[values_output, total_output, text_output])
298
 
299
- gr.Examples(['Example1(scannedDoc).pdf', 'Example2.pdf', 'Example3Large.pdf'], inputs = pdf_input,
300
- cache_examples = True, fn = ocr_interface, outputs = [values_output, total_output, text_output])
301
 
302
  demo.launch()
 
203
  return values, return_text
204
 
205
 
 
 
 
 
 
 
 
 
 
206
 
207
  def pdf_ocr(file, model_t, question):
208
  # Convert PDF to image
 
287
  extract_button.click(fn = ocr_interface,
288
  inputs=[pdf_input, model_input, question_input], outputs=[values_output, total_output, text_output])
289
 
290
+
 
291
 
292
  demo.launch()