Update app.py
Browse files
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.
|
40 |
-
gr.
|
41 |
-
gr.
|
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",
|