Spaces:
Running
Running
Commit
·
a3a9ed2
1
Parent(s):
efee337
Update app.py
Browse files
app.py
CHANGED
|
@@ -100,8 +100,8 @@ class SemanticSearch:
|
|
| 100 |
def load_recommender(path, openAI_key, start_page=1):
|
| 101 |
global recommender
|
| 102 |
texts = pdf_to_text(path, start_page=start_page)
|
| 103 |
-
chunks = text_to_chunks(texts, start_page=start_page
|
| 104 |
-
recommender = SemanticSearch(
|
| 105 |
recommender.fit(chunks)
|
| 106 |
return 'Corpus Loaded.'
|
| 107 |
|
|
@@ -193,3 +193,4 @@ with gr.Blocks() as demo:
|
|
| 193 |
btn.click(question_answer, inputs=[url, file, question, openAI_key], outputs=[answer])
|
| 194 |
|
| 195 |
demo.launch()
|
|
|
|
|
|
| 100 |
def load_recommender(path, openAI_key, start_page=1):
|
| 101 |
global recommender
|
| 102 |
texts = pdf_to_text(path, start_page=start_page)
|
| 103 |
+
chunks = text_to_chunks(texts, start_page=start_page)
|
| 104 |
+
recommender = SemanticSearch()
|
| 105 |
recommender.fit(chunks)
|
| 106 |
return 'Corpus Loaded.'
|
| 107 |
|
|
|
|
| 193 |
btn.click(question_answer, inputs=[url, file, question, openAI_key], outputs=[answer])
|
| 194 |
|
| 195 |
demo.launch()
|
| 196 |
+
recommender = SemanticSearch(openAI_key)
|