Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,7 +65,7 @@ def load_pdf(file_path):
|
|
| 65 |
if text:
|
| 66 |
chunks.append(text)
|
| 67 |
|
| 68 |
-
store_name = file_path
|
| 69 |
|
| 70 |
if os.path.exists(f"{store_name}.pkl"):
|
| 71 |
with open(f"{store_name}.pkl", "rb") as f:
|
|
@@ -78,6 +78,7 @@ def load_pdf(file_path):
|
|
| 78 |
|
| 79 |
return VectorStore
|
| 80 |
|
|
|
|
| 81 |
def load_chatbot(max_tokens=300):
|
| 82 |
return load_qa_chain(llm=OpenAI(temperature=0.1, max_tokens=max_tokens), chain_type="stuff")
|
| 83 |
|
|
|
|
| 65 |
if text:
|
| 66 |
chunks.append(text)
|
| 67 |
|
| 68 |
+
store_name = os.path.basename(file_path)[:-4]
|
| 69 |
|
| 70 |
if os.path.exists(f"{store_name}.pkl"):
|
| 71 |
with open(f"{store_name}.pkl", "rb") as f:
|
|
|
|
| 78 |
|
| 79 |
return VectorStore
|
| 80 |
|
| 81 |
+
|
| 82 |
def load_chatbot(max_tokens=300):
|
| 83 |
return load_qa_chain(llm=OpenAI(temperature=0.1, max_tokens=max_tokens), chain_type="stuff")
|
| 84 |
|