Spaces:
Sleeping
Sleeping
vtrv.vls
commited on
Commit
·
ce0391b
1
Parent(s):
f25336d
API fix
Browse files
app.py
CHANGED
@@ -39,8 +39,9 @@ def qwen_gen(content, chat_history):
|
|
39 |
send_to_s3(res, f'protobench/tiny_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
|
40 |
return '', chat_history
|
41 |
|
42 |
-
def
|
43 |
-
|
|
|
44 |
|
45 |
MODEL_LIB = {'RUBASE': giga_gen, 'TINYLLAMA': tiny_gen, 'QWEN2INS1B': qwen_gen}
|
46 |
|
@@ -48,11 +49,9 @@ def tab_arena():
|
|
48 |
with gradio.Row():
|
49 |
with gradio.Column():
|
50 |
model_left = gradio.Dropdown(["TINYLLAMA", "QWEN2INS1B", "RUBASE"], value="TINYLLAMA", interactive=True, multiselect=False, label="Left model")
|
51 |
-
print(model_left)
|
52 |
chatbot_left = gradio.Chatbot()
|
53 |
with gradio.Column():
|
54 |
model_right = gradio.Dropdown(["TINYLLAMA", "QWEN2INS1B", "RUBASE"], value= "RUBASE", interactive=True, multiselect=False, label="Right model")
|
55 |
-
print(model_right)
|
56 |
chatbot_right = gradio.Chatbot()
|
57 |
|
58 |
with gradio.Row():
|
@@ -70,8 +69,8 @@ def tab_arena():
|
|
70 |
# time.sleep(2)
|
71 |
# return "", chat_history
|
72 |
|
73 |
-
msg.submit(
|
74 |
-
msg.submit(
|
75 |
|
76 |
# with gradio.Column():
|
77 |
# gradio.ChatInterface(
|
|
|
39 |
send_to_s3(res, f'protobench/tiny_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
|
40 |
return '', chat_history
|
41 |
|
42 |
+
def model_gen(content, model_type: str, chat_history):
|
43 |
+
gen = MODEL_LIB[model_type]
|
44 |
+
return gen(content, chat_history)
|
45 |
|
46 |
MODEL_LIB = {'RUBASE': giga_gen, 'TINYLLAMA': tiny_gen, 'QWEN2INS1B': qwen_gen}
|
47 |
|
|
|
49 |
with gradio.Row():
|
50 |
with gradio.Column():
|
51 |
model_left = gradio.Dropdown(["TINYLLAMA", "QWEN2INS1B", "RUBASE"], value="TINYLLAMA", interactive=True, multiselect=False, label="Left model")
|
|
|
52 |
chatbot_left = gradio.Chatbot()
|
53 |
with gradio.Column():
|
54 |
model_right = gradio.Dropdown(["TINYLLAMA", "QWEN2INS1B", "RUBASE"], value= "RUBASE", interactive=True, multiselect=False, label="Right model")
|
|
|
55 |
chatbot_right = gradio.Chatbot()
|
56 |
|
57 |
with gradio.Row():
|
|
|
69 |
# time.sleep(2)
|
70 |
# return "", chat_history
|
71 |
|
72 |
+
msg.submit(model_gen, [msg, model_left, chatbot_left], [msg, model_left, chatbot_left])
|
73 |
+
msg.submit(model_gen, [msg, model_left, chatbot_right], [msg, model_left, chatbot_right])
|
74 |
|
75 |
# with gradio.Column():
|
76 |
# gradio.ChatInterface(
|