Spaces:
Runtime error
Runtime error
starsnatched
commited on
Commit
·
a74f4b0
1
Parent(s):
9e68ce9
Add test file and update document upload logic in run.py
Browse files- .gitignore +3 -0
- run.py +3 -2
- test.txt +4 -0
.gitignore
CHANGED
@@ -26,6 +26,9 @@ share/python-wheels/
|
|
26 |
*.egg
|
27 |
MANIFEST
|
28 |
|
|
|
|
|
|
|
29 |
# PyInstaller
|
30 |
# Usually these files are written by a python script from a template
|
31 |
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
|
26 |
*.egg
|
27 |
MANIFEST
|
28 |
|
29 |
+
# Documents
|
30 |
+
uploads/
|
31 |
+
|
32 |
# PyInstaller
|
33 |
# Usually these files are written by a python script from a template
|
34 |
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
run.py
CHANGED
@@ -7,8 +7,9 @@ from src.chat import ChatSession
|
|
7 |
|
8 |
async def _main() -> None:
|
9 |
async with ChatSession(user="demo_user", session="demo_session") as chat:
|
10 |
-
doc_path = chat.upload_document("
|
11 |
-
|
|
|
12 |
print("\n>>>", answer)
|
13 |
|
14 |
|
|
|
7 |
|
8 |
async def _main() -> None:
|
9 |
async with ChatSession(user="demo_user", session="demo_session") as chat:
|
10 |
+
doc_path = chat.upload_document("test.txt")
|
11 |
+
print(f"Document uploaded to VM at: {doc_path}")
|
12 |
+
answer = await chat.chat(f"What's in {doc_path}?")
|
13 |
print("\n>>>", answer)
|
14 |
|
15 |
|
test.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
This is a test file.
|
2 |
+
Blah blah blah.
|
3 |
+
Hello, world!
|
4 |
+
Python is awesome!
|