Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,15 +10,14 @@ from langchain_community.chat_models import ChatOllama
|
|
| 10 |
from basesrc.strategies import convert_pdf_to_text, split_pages_into_chunks, vectorize
|
| 11 |
from prompt_query import generate_prompt
|
| 12 |
|
| 13 |
-
|
| 14 |
-
CACHE_FOLDER =
|
| 15 |
-
CACHE_FOLDER = "./cache" # si toutefois (¨_^)
|
| 16 |
|
| 17 |
def create_interface(pdf_url, embedding_model, llm_model, top_k=5):
|
| 18 |
os.makedirs(CACHE_FOLDER, exist_ok=True)
|
| 19 |
response = requests.get(pdf_url)
|
| 20 |
pdf_filename = pdf_url.split('/')[-1]
|
| 21 |
-
pdf_path = os.path.join(
|
| 22 |
with open(pdf_path, 'wb') as f:
|
| 23 |
f.write(response.content)
|
| 24 |
|
|
|
|
| 10 |
from basesrc.strategies import convert_pdf_to_text, split_pages_into_chunks, vectorize
|
| 11 |
from prompt_query import generate_prompt
|
| 12 |
|
| 13 |
+
|
| 14 |
+
#CACHE_FOLDER = "./cache" # si toutefois (¨_^)
|
|
|
|
| 15 |
|
| 16 |
def create_interface(pdf_url, embedding_model, llm_model, top_k=5):
|
| 17 |
os.makedirs(CACHE_FOLDER, exist_ok=True)
|
| 18 |
response = requests.get(pdf_url)
|
| 19 |
pdf_filename = pdf_url.split('/')[-1]
|
| 20 |
+
pdf_path = os.path.join(None, 'document.pdf')
|
| 21 |
with open(pdf_path, 'wb') as f:
|
| 22 |
f.write(response.content)
|
| 23 |
|