Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import asyncio
|
4 |
-
from
|
5 |
-
from
|
6 |
-
from
|
7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
8 |
import google.generativeai as genai
|
9 |
|
@@ -42,5 +42,3 @@ 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()
|
45 |
-
|
46 |
-
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import asyncio
|
4 |
+
from langchain_core.prompts import PromptTemplate
|
5 |
+
from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser
|
6 |
+
from langchain_community.document_loaders import PyPDFLoader
|
7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
8 |
import google.generativeai as genai
|
9 |
|
|
|
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()
|
|
|
|