muradkhan commited on
Commit
bf9d3cd
1 Parent(s): 86d3138

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,8 +1,6 @@
1
  from pprint import pprint
2
- from getpass import getpass
3
  from PyPDF2 import PdfReader
4
  import gradio as gr
5
- import os
6
  from transformers import pipeline
7
 
8
  # Function to read PDF file content directly
@@ -36,9 +34,9 @@ def gradio_interface(file, hf_token, questions):
36
  interface = gr.Interface(
37
  fn=gradio_interface,
38
  inputs=[
39
- gr.inputs.File(file_count="single", type="file", label="Upload Invoice (PDF)"),
40
- gr.inputs.Textbox(type="password", label="Enter your Hugging Face Token"),
41
- gr.inputs.Textbox(lines=5, placeholder="Enter your questions separated by commas")
42
  ],
43
  outputs="json",
44
  title="Invoice Data Extraction",
 
1
  from pprint import pprint
 
2
  from PyPDF2 import PdfReader
3
  import gradio as gr
 
4
  from transformers import pipeline
5
 
6
  # Function to read PDF file content directly
 
34
  interface = gr.Interface(
35
  fn=gradio_interface,
36
  inputs=[
37
+ gr.File(file_count="single", label="Upload Invoice (PDF)"),
38
+ gr.Textbox(type="password", label="Enter your Hugging Face Token"),
39
+ gr.Textbox(lines=5, placeholder="Enter your questions separated by commas")
40
  ],
41
  outputs="json",
42
  title="Invoice Data Extraction",