Spaces:
Sleeping
Sleeping
vtrv.vls
commited on
Commit
·
9540a56
1
Parent(s):
409cbac
Clear inputs on model change
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import os
|
|
| 4 |
import boto3
|
| 5 |
from datetime import datetime
|
| 6 |
import pandas as pd
|
|
|
|
| 7 |
|
| 8 |
from utils import generate, send_to_s3
|
| 9 |
from models import get_tinyllama, get_qwen2ins1b, response_tinyllama, response_qwen2ins1b
|
|
@@ -55,11 +56,9 @@ def model_regen(content, chat_history, model_type: str):
|
|
| 55 |
|
| 56 |
gen = MODEL_LIB[model_type]
|
| 57 |
|
| 58 |
-
msg = chat_history[-1][0]
|
| 59 |
-
chat_history = chat_history[:-1]
|
| 60 |
-
chat_history.append([msg])
|
| 61 |
|
| 62 |
-
return gen(
|
| 63 |
|
| 64 |
def clear_chat():
|
| 65 |
return '', []
|
|
|
|
| 4 |
import boto3
|
| 5 |
from datetime import datetime
|
| 6 |
import pandas as pd
|
| 7 |
+
from copy import copy
|
| 8 |
|
| 9 |
from utils import generate, send_to_s3
|
| 10 |
from models import get_tinyllama, get_qwen2ins1b, response_tinyllama, response_qwen2ins1b
|
|
|
|
| 56 |
|
| 57 |
gen = MODEL_LIB[model_type]
|
| 58 |
|
| 59 |
+
msg = copy(chat_history[-1][0])
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
return gen(msg, chat_history[:-1])
|
| 62 |
|
| 63 |
def clear_chat():
|
| 64 |
return '', []
|