Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
6 |
checkpoint = "."
|
7 |
|
8 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
9 |
-
|
|
|
10 |
def load_model(model_name):
|
11 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
12 |
return model
|
|
|
6 |
checkpoint = "."
|
7 |
|
8 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
9 |
+
|
10 |
+
@st.cache_resource
|
11 |
def load_model(model_name):
|
12 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
13 |
return model
|