vtrv.vls commited on
Commit
1847ea5
·
1 Parent(s): 2e4aa42
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -13,6 +13,9 @@ MERA_table = None
13
  TINYLLAMA = None
14
  QWEN2INS1B = None
15
 
 
 
 
16
  S3_SESSION = None
17
 
18
  def giga_gen(content, chat_history):
@@ -36,6 +39,9 @@ def qwen_gen(content, chat_history):
36
  send_to_s3(res, f'protobench/tiny_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
37
  return '', chat_history
38
 
 
 
 
39
  MODEL_LIB = {'RUBASE': giga_gen, 'TINYLLAMA': tiny_gen, 'QWEN2INS1B': qwen_gen}
40
 
41
  def tab_arena():
@@ -62,6 +68,12 @@ def tab_arena():
62
  # time.sleep(2)
63
  # return "", chat_history
64
 
 
 
 
 
 
 
65
  msg.submit(giga_gen, [msg, chatbot_left], [msg, chatbot_left])
66
  msg.submit(qwen_gen, [msg, chatbot_right], [msg, chatbot_right])
67
 
 
13
  TINYLLAMA = None
14
  QWEN2INS1B = None
15
 
16
+ RIGHT_MODEL = None
17
+ LEFT_MODEL = None
18
+
19
  S3_SESSION = None
20
 
21
  def giga_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 change_model(model, model_key):
43
+ model = MODEL_LIB[model_key]
44
+
45
  MODEL_LIB = {'RUBASE': giga_gen, 'TINYLLAMA': tiny_gen, 'QWEN2INS1B': qwen_gen}
46
 
47
  def tab_arena():
 
68
  # time.sleep(2)
69
  # return "", chat_history
70
 
71
+ model_left.change(change_model, [LEFT_MODEL, model_left])
72
+ model_right.change(change_model, [RIGHT_MODEL, model_right])
73
+
74
+ print(LEFT_MODEL)
75
+ print(RIGHT_MODEL)
76
+
77
  msg.submit(giga_gen, [msg, chatbot_left], [msg, chatbot_left])
78
  msg.submit(qwen_gen, [msg, chatbot_right], [msg, chatbot_right])
79