Spaces:
Sleeping
Sleeping
Commit
·
160ee8a
1
Parent(s):
2968e66
adding chatbot
Browse files
app.py
CHANGED
@@ -59,6 +59,7 @@ def document_loader(file_path,api_key,doc_type='pdf',llm='Huggingface'):
|
|
59 |
elif doc_type == 'word':
|
60 |
document = process_word_document(document_file=file_path)
|
61 |
if document:
|
|
|
62 |
embedding_model = SentenceTransformerEmbeddings(model_name='thenlper/gte-base',model_kwargs={"device": DEVICE})
|
63 |
texts = process_documents(documents=document)
|
64 |
vector_db = FAISS.from_documents(documents=texts, embedding= embedding_model)
|
@@ -69,7 +70,6 @@ def document_loader(file_path,api_key,doc_type='pdf',llm='Huggingface'):
|
|
69 |
# chain_type_kwargs=chain_type_kwargs,
|
70 |
return_source_documents=True
|
71 |
)
|
72 |
-
print(qa)
|
73 |
else:
|
74 |
return "Error in loading Documents "
|
75 |
|
|
|
59 |
elif doc_type == 'word':
|
60 |
document = process_word_document(document_file=file_path)
|
61 |
if document:
|
62 |
+
print(document)
|
63 |
embedding_model = SentenceTransformerEmbeddings(model_name='thenlper/gte-base',model_kwargs={"device": DEVICE})
|
64 |
texts = process_documents(documents=document)
|
65 |
vector_db = FAISS.from_documents(documents=texts, embedding= embedding_model)
|
|
|
70 |
# chain_type_kwargs=chain_type_kwargs,
|
71 |
return_source_documents=True
|
72 |
)
|
|
|
73 |
else:
|
74 |
return "Error in loading Documents "
|
75 |
|