Spaces:
Paused
Paused
angry-meow
commited on
Commit
•
bd1653c
1
Parent(s):
d3629e8
url loading testing
Browse files
app.py
CHANGED
@@ -28,12 +28,16 @@ async def main(message: cl.Message):
|
|
28 |
else:
|
29 |
message_type = "question"
|
30 |
|
|
|
|
|
|
|
|
|
31 |
if message_type == "url":
|
32 |
# load the file
|
33 |
docs = load_documents_from_url(message.content)
|
34 |
-
cl.Message("loaded docs").send()
|
35 |
splits = models.semanticChunker_tuned.split_documents(docs)
|
36 |
-
cl.Message("split docs").send()
|
37 |
for i, doc in enumerate(splits):
|
38 |
doc.metadata["user_upload_source"] = f"source_{i}"
|
39 |
print(f"Processing {len(docs)} text chunks")
|
|
|
28 |
else:
|
29 |
message_type = "question"
|
30 |
|
31 |
+
await cl.Message(
|
32 |
+
content=f"message_type: {message_type}",
|
33 |
+
).send()
|
34 |
+
|
35 |
if message_type == "url":
|
36 |
# load the file
|
37 |
docs = load_documents_from_url(message.content)
|
38 |
+
await cl.Message(content="loaded docs").send()
|
39 |
splits = models.semanticChunker_tuned.split_documents(docs)
|
40 |
+
await cl.Message(content="split docs").send()
|
41 |
for i, doc in enumerate(splits):
|
42 |
doc.metadata["user_upload_source"] = f"source_{i}"
|
43 |
print(f"Processing {len(docs)} text chunks")
|