Update app.py
Browse files
app.py
CHANGED
@@ -36,18 +36,12 @@ def pdf_to_text(pdf_file, query):
|
|
36 |
qa = VectorDBQA.from_chain_type(llm=OpenAI(), chain_type="stuff", vectorstore=vectorstore)
|
37 |
return qa.run(query)
|
38 |
|
39 |
-
examples = [
|
40 |
-
[os.path.abspath("NASDAQ_AAPL_2020.pdf"), "how much are the outstanding shares ?"],
|
41 |
-
[os.path.abspath("NASDAQ_AAPL_2020.pdf"), "what is competitors strategy ?"],
|
42 |
-
[os.path.abspath("NASDAQ_AAPL_2020.pdf"), "who is the chief executive officer ?"],
|
43 |
-
[os.path.abspath("NASDAQ_MSFT_2020.pdf"), "How much is the guided revenue for next quarter?"],
|
44 |
-
]
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
# Define the Gradio interface
|
50 |
-
pdf_input = [gr.inputs.File(label="PDF File")
|
51 |
query_input = gr.inputs.Textbox(label="Query")
|
52 |
outputs = gr.outputs.Textbox(label="Chatbot Response")
|
53 |
|
|
|
36 |
qa = VectorDBQA.from_chain_type(llm=OpenAI(), chain_type="stuff", vectorstore=vectorstore)
|
37 |
return qa.run(query)
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
# Define the Gradio interface
|
44 |
+
pdf_input = [gr.inputs.File(label="PDF File")]
|
45 |
query_input = gr.inputs.Textbox(label="Query")
|
46 |
outputs = gr.outputs.Textbox(label="Chatbot Response")
|
47 |
|