MohamedRashad commited on
Commit
6f2f73e
1 Parent(s): 45266c6

Refactor model ID handling and tie weights in app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -43,6 +43,7 @@ def load_model_a(model_id):
43
  device_map="auto",
44
  trust_remote_code=True,
45
  ).eval()
 
46
  return gr.update(label=model_id)
47
 
48
  def load_model_b(model_id):
@@ -66,6 +67,7 @@ def load_model_b(model_id):
66
  device_map="auto",
67
  trust_remote_code=True,
68
  ).eval()
 
69
  return gr.update(label=model_id)
70
 
71
  @spaces.GPU()
 
43
  device_map="auto",
44
  trust_remote_code=True,
45
  ).eval()
46
+ model_a.tie_weights()
47
  return gr.update(label=model_id)
48
 
49
  def load_model_b(model_id):
 
67
  device_map="auto",
68
  trust_remote_code=True,
69
  ).eval()
70
+ model_b.tie_weights()
71
  return gr.update(label=model_id)
72
 
73
  @spaces.GPU()