FEAT: change to prompt text
Browse files- BuildingAChainlitApp.md +11 -0
- app.py +1 -1
BuildingAChainlitApp.md
CHANGED
@@ -133,6 +133,17 @@ Simply put, this downloads the file as a temp file, we load it in with `TextFile
|
|
133 |
|
134 |
Why do we want to support streaming? What about streaming is important, or useful?
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
## On Chat Start:
|
137 |
|
138 |
The next scope is where "the magic happens". On Chat Start is when a user begins a chat session. This will happen whenever a user opens a new chat window, or refreshes an existing chat window.
|
|
|
133 |
|
134 |
Why do we want to support streaming? What about streaming is important, or useful?
|
135 |
|
136 |
+
Streaming is the continuous transmission of the data from the model to the UI. Instead of waiting and batching up the response into a single
|
137 |
+
large message, the response is sent in pieces (streams) as it is created.
|
138 |
+
|
139 |
+
The advantages of streaming:
|
140 |
+
- quicker initial response - the user sees the first part of the answer sooner
|
141 |
+
- it is easier to identify the results are incorrect and terminate the request
|
142 |
+
- it is a more natural mode of communication for humans
|
143 |
+
- better handling of large data, not requiring complex caching
|
144 |
+
- essential for real time processing
|
145 |
+
- humans can only read so fast so its an advantage to get some of the data earlier
|
146 |
+
|
147 |
## On Chat Start:
|
148 |
|
149 |
The next scope is where "the magic happens". On Chat Start is when a user begins a chat session. This will happen whenever a user opens a new chat window, or refreshes an existing chat window.
|
app.py
CHANGED
@@ -72,7 +72,7 @@ async def on_chat_start():
|
|
72 |
# Wait for the user to upload a file
|
73 |
while files == None:
|
74 |
files = await cl.AskFileMessage(
|
75 |
-
content="Please upload a
|
76 |
accept=["text/plain"],
|
77 |
max_size_mb=2,
|
78 |
timeout=180,
|
|
|
72 |
# Wait for the user to upload a file
|
73 |
while files == None:
|
74 |
files = await cl.AskFileMessage(
|
75 |
+
content="Please upload a .txt or .pdf File file to begin!",
|
76 |
accept=["text/plain"],
|
77 |
max_size_mb=2,
|
78 |
timeout=180,
|