Spaces:
Sleeping
Sleeping
Commit
·
094db07
1
Parent(s):
cacebca
Update app.py
Browse files
app.py
CHANGED
@@ -47,12 +47,16 @@ async def on_chat_start():
|
|
47 |
file = files[0]
|
48 |
|
49 |
msg = cl.Message(
|
50 |
-
content=f"
|
51 |
)
|
52 |
await msg.send()
|
53 |
-
|
54 |
-
|
|
|
55 |
documents = text_loader.load_documents()
|
|
|
|
|
|
|
56 |
|
57 |
text_splitter = CharacterTextSplitter()
|
58 |
split_documents = text_splitter.split_texts(documents)
|
@@ -67,7 +71,7 @@ async def on_chat_start():
|
|
67 |
wandb_project="RAQA from Scratch"
|
68 |
)
|
69 |
# Let the user know that the system is ready
|
70 |
-
msg.content = f"
|
71 |
await msg.update()
|
72 |
|
73 |
cl.user_session.set("chain", raqa_retrieval_augmented_qa_pipeline)
|
|
|
47 |
file = files[0]
|
48 |
|
49 |
msg = cl.Message(
|
50 |
+
content=f"Loading Dataset ...", disable_human_feedback=True
|
51 |
)
|
52 |
await msg.send()
|
53 |
+
# print(file.path)
|
54 |
+
# print(file)
|
55 |
+
text_loader = TextFileLoader('data/KingLear.txt')
|
56 |
documents = text_loader.load_documents()
|
57 |
+
# documents = [file.content]
|
58 |
+
# print(documents)
|
59 |
+
|
60 |
|
61 |
text_splitter = CharacterTextSplitter()
|
62 |
split_documents = text_splitter.split_texts(documents)
|
|
|
71 |
wandb_project="RAQA from Scratch"
|
72 |
)
|
73 |
# Let the user know that the system is ready
|
74 |
+
msg.content = f"Dataset loading is done. You can now ask questions!"
|
75 |
await msg.update()
|
76 |
|
77 |
cl.user_session.set("chain", raqa_retrieval_augmented_qa_pipeline)
|