Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
186 |
-
|
|
|
|
|
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
|