cloneQ commited on
Commit
d887d21
1 Parent(s): 096967f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -181,9 +181,11 @@ def on_btn_click():
181
 
182
  @st.cache_resource
183
  def load_model():
184
- model = (AutoModelForCausalLM.from_pretrained(
185
- model_name_or_path,
186
- trust_remote_code=True).to(torch.bfloat16).cuda())
 
 
187
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path,
188
  trust_remote_code=True)
189
  return model, tokenizer
 
181
 
182
  @st.cache_resource
183
  def load_model():
184
+ # model = (AutoModelForCausalLM.from_pretrained(
185
+ # model_name_or_path,
186
+ # trust_remote_code=True).to(torch.bfloat16).cuda())
187
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path)
188
+ model.to_bettertransformer()
189
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path,
190
  trust_remote_code=True)
191
  return model, tokenizer