gsarti commited on
Commit
f0e0d32
β€’
1 Parent(s): 8cbce46

Fix preload with kwargs

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -160,8 +160,8 @@ def preload_model(
160
  loaded_model = HuggingfaceModel.load(
161
  model_name_or_path,
162
  attribution_method,
163
- model_kwargs=json.loads(model_kwargs),
164
- tokenizer_kwargs=json.loads(tokenizer_kwargs),
165
  )
166
  if loaded_model.tokenizer.pad_token is None:
167
  loaded_model.tokenizer.add_special_tokens({"pad_token": "[PAD]"})
 
160
  loaded_model = HuggingfaceModel.load(
161
  model_name_or_path,
162
  attribution_method,
163
+ model_kwargs={**json.loads(model_kwargs), **{"token": os.environ["HF_TOKEN"], "trust_remote_code": True}},
164
+ tokenizer_kwargs={**json.loads(tokenizer_kwargs), **{"token": os.environ["HF_TOKEN"], "trust_remote_code": True}},
165
  )
166
  if loaded_model.tokenizer.pad_token is None:
167
  loaded_model.tokenizer.add_special_tokens({"pad_token": "[PAD]"})