muellerzr HF staff commited on
Commit
1b9898b
·
1 Parent(s): 2758f77

Togethercompute

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -76,7 +76,9 @@ def calculate_memory(model_name:str, library:str, options:list, access_token:str
76
  library = check_has_model(e)
77
  if library != "unknown":
78
  raise gr.Error(f"Tried to load `{model_name}` with `{library}` but a possible model to load was not found inside the repo.")
79
-
 
 
80
  total_size, largest_layer = calculate_maximum_sizes(model)
81
 
82
  data = []
 
76
  library = check_has_model(e)
77
  if library != "unknown":
78
  raise gr.Error(f"Tried to load `{model_name}` with `{library}` but a possible model to load was not found inside the repo.")
79
+ except ImportError:
80
+ # hacky way to check if it works with `trust_remote_code=False`
81
+ model = create_empty_model(model_name, library_name=library, trust_remote_code=False, access_token=access_token)
82
  total_size, largest_layer = calculate_maximum_sizes(model)
83
 
84
  data = []