fixed response
Browse files
app.py
CHANGED
@@ -544,15 +544,15 @@ if __name__ == '__main__':
|
|
544 |
|
545 |
image_gallery = returnImages()
|
546 |
|
547 |
-
for token in bot_response
|
548 |
-
if "eot_id" in token:
|
549 |
token = token.replace("<|eot_id|>","")
|
550 |
-
if token.startswith("-"):
|
551 |
token = f"\n{token}"
|
552 |
-
if re.match(r"^[1-9]\.",token):
|
553 |
token = f"\n{token}"
|
554 |
|
555 |
-
history[-1]['content'] += token
|
556 |
yield history, image_gallery
|
557 |
end = time.time()
|
558 |
print("End2End Query took", end - start, "seconds!")
|
|
|
544 |
|
545 |
image_gallery = returnImages()
|
546 |
|
547 |
+
for token in bot_response:
|
548 |
+
if "eot_id" in token.choices[0].delta.content:
|
549 |
token = token.replace("<|eot_id|>","")
|
550 |
+
if token.choices[0].delta.content.startswith("-"):
|
551 |
token = f"\n{token}"
|
552 |
+
if re.match(r"^[1-9]\.",token.choices[0].delta.content):
|
553 |
token = f"\n{token}"
|
554 |
|
555 |
+
history[-1]['content'] += token.choices[0].delta.content
|
556 |
yield history, image_gallery
|
557 |
end = time.time()
|
558 |
print("End2End Query took", end - start, "seconds!")
|