Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from langchain_community.output_parsers.rail_parser import GuardrailsOutputParse
|
|
6 |
from langchain_community.document_loaders import PyPDFLoader
|
7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
8 |
import google.generativeai as genai
|
|
|
9 |
|
10 |
|
11 |
async def initialize(file_path, question):
|
@@ -42,3 +43,4 @@ async def pdf_qa(file, question):
|
|
42 |
|
43 |
# Create Gradio Interface
|
44 |
gr.Interface(fn=pdf_qa, inputs=[input_file, input_question], outputs=output_text, title="PDF Question Answering System", description="Upload a PDF file and ask questions about the content.").launch()
|
|
|
|
6 |
from langchain_community.document_loaders import PyPDFLoader
|
7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
8 |
import google.generativeai as genai
|
9 |
+
from langchain.chains.question_answering import load_qa_chain # Import load_qa_chain
|
10 |
|
11 |
|
12 |
async def initialize(file_path, question):
|
|
|
43 |
|
44 |
# Create Gradio Interface
|
45 |
gr.Interface(fn=pdf_qa, inputs=[input_file, input_question], outputs=output_text, title="PDF Question Answering System", description="Upload a PDF file and ask questions about the content.").launch()
|
46 |
+
|