Update app.py
Browse files
app.py
CHANGED
@@ -146,15 +146,22 @@ def generate(prompt, history):
|
|
146 |
|
147 |
response = ""
|
148 |
|
149 |
-
while(len(response) < 1):
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
context += response
|
155 |
print (context)
|
156 |
|
157 |
-
history.append(
|
158 |
yield response
|
159 |
|
160 |
else:
|
|
|
146 |
|
147 |
response = ""
|
148 |
|
149 |
+
# while(len(response) < 1):
|
150 |
+
# output = llm(context, max_tokens=400, stop=["Nurse:"], echo=False)
|
151 |
+
# response = output["choices"][0]["text"]
|
152 |
+
# response = response.strip()
|
153 |
+
|
154 |
+
for output in llm(input, stream=True, max_tokens=100, ):
|
155 |
+
piece = output['choices'][0]['text']
|
156 |
+
response += piece
|
157 |
+
chatbot[-1] = (chatbot[-1][0], response)
|
158 |
+
|
159 |
+
yield response
|
160 |
|
161 |
context += response
|
162 |
print (context)
|
163 |
|
164 |
+
history.append(response)
|
165 |
yield response
|
166 |
|
167 |
else:
|