Spaces:
Running
Running
Commit
·
c0af0be
1
Parent(s):
ba7a366
Update app.py
Browse files
app.py
CHANGED
@@ -160,8 +160,11 @@ def question_answer(url, file, question):
|
|
160 |
return generate_answer(question)
|
161 |
|
162 |
|
163 |
-
title = '
|
164 |
-
description = "
|
|
|
|
|
|
|
165 |
|
166 |
with gr.Blocks() as demo:
|
167 |
|
@@ -174,12 +177,12 @@ with gr.Blocks() as demo:
|
|
174 |
url = gr.Textbox(label='URL')
|
175 |
gr.Markdown("<center><h6>or<h6></center>")
|
176 |
file = gr.File(label='PDF', file_types=['.pdf'])
|
177 |
-
question = gr.Textbox(label='question')
|
178 |
btn = gr.Button(value='Submit')
|
179 |
btn.style(full_width=True)
|
180 |
|
181 |
with gr.Group():
|
182 |
-
answer = gr.Textbox(label='answer')
|
183 |
|
184 |
btn.click(question_answer, inputs=[url, file, question], outputs=[answer])
|
185 |
|
|
|
160 |
return generate_answer(question)
|
161 |
|
162 |
|
163 |
+
title = 'PDF GPT'
|
164 |
+
description = """PDF GPT allows you to chat with a PDF file using GPT functionalities. The application intelligently breaks the document into smaller chunks and employs a powerful Deep Averaging Network Encoder to generate embeddings. To generate a summary for each chunk, PDF GPT utilizes Open AI as its data layer.
|
165 |
+
PDF GPT uses a KNN algorithm to return the top-n embedding from each chunk and uses a custom logic to generate a response.
|
166 |
+
The application also leverages important document sections to generate precise responses, and
|
167 |
+
can even provide the page number where the information is located, adding credibility to the responses and helping to locate pertinent information quickly."""
|
168 |
|
169 |
with gr.Blocks() as demo:
|
170 |
|
|
|
177 |
url = gr.Textbox(label='URL')
|
178 |
gr.Markdown("<center><h6>or<h6></center>")
|
179 |
file = gr.File(label='PDF', file_types=['.pdf'])
|
180 |
+
question = gr.Textbox(label='Enter your question here')
|
181 |
btn = gr.Button(value='Submit')
|
182 |
btn.style(full_width=True)
|
183 |
|
184 |
with gr.Group():
|
185 |
+
answer = gr.Textbox(label='The answer to your question is :')
|
186 |
|
187 |
btn.click(question_answer, inputs=[url, file, question], outputs=[answer])
|
188 |
|