Update app.py
Browse files
app.py
CHANGED
|
@@ -39,13 +39,14 @@ def pdf_changes(pdf_doc, open_ai_key):
|
|
| 39 |
return "You forgot OpenAI API key"
|
| 40 |
|
| 41 |
def add_text(history, text):
|
| 42 |
-
history = history + [(text,
|
| 43 |
return history, ""
|
| 44 |
|
| 45 |
def bot(history):
|
| 46 |
response = infer(history[-1][0], history)
|
| 47 |
|
| 48 |
for character in response:
|
|
|
|
| 49 |
history[-1][1] += character
|
| 50 |
time.sleep(0.05)
|
| 51 |
yield history
|
|
|
|
| 39 |
return "You forgot OpenAI API key"
|
| 40 |
|
| 41 |
def add_text(history, text):
|
| 42 |
+
history = history + [(text, None)]
|
| 43 |
return history, ""
|
| 44 |
|
| 45 |
def bot(history):
|
| 46 |
response = infer(history[-1][0], history)
|
| 47 |
|
| 48 |
for character in response:
|
| 49 |
+
history[-1][1] = ""
|
| 50 |
history[-1][1] += character
|
| 51 |
time.sleep(0.05)
|
| 52 |
yield history
|