Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,8 @@ import os
|
|
| 9 |
from sklearn.neighbors import NearestNeighbors
|
| 10 |
|
| 11 |
openai.api_key = os.getenv('OpenAPI')
|
|
|
|
|
|
|
| 12 |
|
| 13 |
def download_pdf(url, output_path):
|
| 14 |
urllib.request.urlretrieve(url, output_path)
|
|
@@ -154,11 +156,11 @@ description = """ PDF GPT allows you to chat with your PDF file using Universal
|
|
| 154 |
iface = gr.Interface(
|
| 155 |
fn=question_answer,
|
| 156 |
inputs=[
|
| 157 |
-
gr.inputs.
|
| 158 |
gr.inputs.File(label="Upload PDF file"),
|
| 159 |
-
gr.inputs.
|
| 160 |
],
|
| 161 |
-
outputs=gr.outputs.
|
| 162 |
title=title,
|
| 163 |
description=description
|
| 164 |
)
|
|
|
|
| 9 |
from sklearn.neighbors import NearestNeighbors
|
| 10 |
|
| 11 |
openai.api_key = os.getenv('OpenAPI')
|
| 12 |
+
recommender = SemanticSearch()
|
| 13 |
+
|
| 14 |
|
| 15 |
def download_pdf(url, output_path):
|
| 16 |
urllib.request.urlretrieve(url, output_path)
|
|
|
|
| 156 |
iface = gr.Interface(
|
| 157 |
fn=question_answer,
|
| 158 |
inputs=[
|
| 159 |
+
gr.inputs.Text(label="Enter PDF URL here"),
|
| 160 |
gr.inputs.File(label="Upload PDF file"),
|
| 161 |
+
gr.inputs.Text(label="Enter your question here"),
|
| 162 |
],
|
| 163 |
+
outputs=gr.outputs.Text(label="Generated Answer"),
|
| 164 |
title=title,
|
| 165 |
description=description
|
| 166 |
)
|