ddededstger commited on
Commit
ac31724
Β·
verified Β·
1 Parent(s): 5215f12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -25,9 +25,10 @@ if 'model_type' in config:
25
  with open(config_path, 'w') as f:
26
  json.dump(config, f)
27
 
28
- # Now load the model from modified local dir
29
- model = AutoPeftModelForCausalLM.from_pretrained(local_dir)
30
- tokenizer = AutoTokenizer.from_pretrained(base_model_id)
 
31
  model = model.to(DEVICE)
32
  model.eval()
33
 
 
25
  with open(config_path, 'w') as f:
26
  json.dump(config, f)
27
 
28
+ # Now load the model from modified local dir, passing token for gated base model
29
+ token = os.environ["HF_TOKEN"]
30
+ model = AutoPeftModelForCausalLM.from_pretrained(local_dir, token=token)
31
+ tokenizer = AutoTokenizer.from_pretrained(base_model_id, token=token)
32
  model = model.to(DEVICE)
33
  model.eval()
34