Spaces:
Running
Running
Commit
·
c1dcb26
1
Parent(s):
f15a4e8
Update app.py
Browse files
app.py
CHANGED
@@ -88,9 +88,7 @@ class SemanticSearch:
|
|
88 |
embeddings.append(emb_batch)
|
89 |
embeddings = np.vstack(embeddings)
|
90 |
return embeddings
|
91 |
-
openai.api_key = os.getenv('Your_Key_Here')
|
92 |
|
93 |
-
recommender = SemanticSearch()
|
94 |
|
95 |
|
96 |
def load_recommender(path, start_page=1):
|
@@ -160,6 +158,8 @@ def question_answer(url, file, question):
|
|
160 |
return generate_answer(question)
|
161 |
|
162 |
|
|
|
|
|
163 |
title = 'PDF GPT'
|
164 |
description = """ What is PDF GPT ?
|
165 |
1. PDF GPT allows you to chat with a PDF file using GPT functionalities.
|
@@ -186,7 +186,7 @@ with gr.Blocks() as demo:
|
|
186 |
answer = gr.Textbox(label='The answer to your question is :')
|
187 |
|
188 |
btn.click(question_answer, inputs=[url, file, question], outputs=[answer])
|
189 |
-
|
190 |
demo.launch()
|
191 |
|
192 |
|
|
|
88 |
embeddings.append(emb_batch)
|
89 |
embeddings = np.vstack(embeddings)
|
90 |
return embeddings
|
|
|
91 |
|
|
|
92 |
|
93 |
|
94 |
def load_recommender(path, start_page=1):
|
|
|
158 |
return generate_answer(question)
|
159 |
|
160 |
|
161 |
+
recommender = SemanticSearch()
|
162 |
+
|
163 |
title = 'PDF GPT'
|
164 |
description = """ What is PDF GPT ?
|
165 |
1. PDF GPT allows you to chat with a PDF file using GPT functionalities.
|
|
|
186 |
answer = gr.Textbox(label='The answer to your question is :')
|
187 |
|
188 |
btn.click(question_answer, inputs=[url, file, question], outputs=[answer])
|
189 |
+
openai.api_key = os.getenv('Your_Key_Here')
|
190 |
demo.launch()
|
191 |
|
192 |
|