nuojohnchen commited on
Commit
93599b4
·
verified ·
1 Parent(s): a8fea83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -92,14 +92,16 @@ def load_model(model_path, progress=gr.Progress()):
92
 
93
  try:
94
  progress(0.3, desc="Loading tokenizer...")
95
- current_tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False,trust_remote_code=True,)
 
96
 
97
  progress(0.5, desc="Loading model...")
98
  current_model = AutoModelForCausalLM.from_pretrained(
99
  model_path,
100
  device_map="auto",
101
  torch_dtype=torch.float16,
102
- trust_remote_code=True,
 
103
  )
104
 
105
  current_model_path = model_path
 
92
 
93
  try:
94
  progress(0.3, desc="Loading tokenizer...")
95
+ config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
96
+ current_tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False,trust_remote_code=True)
97
 
98
  progress(0.5, desc="Loading model...")
99
  current_model = AutoModelForCausalLM.from_pretrained(
100
  model_path,
101
  device_map="auto",
102
  torch_dtype=torch.float16,
103
+ config=config,
104
+ trust_remote_code=True
105
  )
106
 
107
  current_model_path = model_path