Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -78,9 +78,9 @@ def process_text_file(file: AskFileResponse):
|
|
78 |
documents = pdf_loader.load()
|
79 |
else:
|
80 |
raise ValueError("Provide a .txt or .pdf file")
|
81 |
-
texts = [x.page_content for x in text_splitter.transform_documents(documents)]
|
82 |
# texts = [x.page_content for x in text_splitter.split_documents(documents)]
|
83 |
-
return
|
84 |
|
85 |
|
86 |
|
@@ -122,9 +122,7 @@ async def on_chat_start():
|
|
122 |
# vector_db_retriever=vector_db,
|
123 |
# llm=chat_openai
|
124 |
# )
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
# model = SentenceTransformer("acpotts/finetuned_arctic")
|
129 |
|
130 |
finetune_embeddings = HuggingFaceEmbeddings(model_name='acpotts/finetuned_arctic')
|
@@ -165,4 +163,4 @@ async def main(message):
|
|
165 |
async for stream_resp in result["response"]:
|
166 |
await msg.stream_token(stream_resp)
|
167 |
|
168 |
-
await msg.send()
|
|
|
78 |
documents = pdf_loader.load()
|
79 |
else:
|
80 |
raise ValueError("Provide a .txt or .pdf file")
|
81 |
+
#texts = [x.page_content for x in text_splitter.transform_documents(documents)]
|
82 |
# texts = [x.page_content for x in text_splitter.split_documents(documents)]
|
83 |
+
return text_splitter.split_documents(documents)
|
84 |
|
85 |
|
86 |
|
|
|
122 |
# vector_db_retriever=vector_db,
|
123 |
# llm=chat_openai
|
124 |
# )
|
125 |
+
|
|
|
|
|
126 |
# model = SentenceTransformer("acpotts/finetuned_arctic")
|
127 |
|
128 |
finetune_embeddings = HuggingFaceEmbeddings(model_name='acpotts/finetuned_arctic')
|
|
|
163 |
async for stream_resp in result["response"]:
|
164 |
await msg.stream_token(stream_resp)
|
165 |
|
166 |
+
await msg.send()
|