Update app.py
Browse files
app.py
CHANGED
@@ -46,11 +46,11 @@ def color_dataframe(row):
|
|
46 |
styles.append(f"background-color: None")
|
47 |
return styles
|
48 |
|
49 |
-
@st.
|
50 |
def load_tokenizer(model_ckpt):
|
51 |
return AutoTokenizer.from_pretrained(model_ckpt)
|
52 |
|
53 |
-
@st.
|
54 |
def load_model(model_ckpt):
|
55 |
model = AutoModelForCausalLM.from_pretrained(model_ckpt)
|
56 |
return model
|
|
|
46 |
styles.append(f"background-color: None")
|
47 |
return styles
|
48 |
|
49 |
+
@st.cache_resource
|
50 |
def load_tokenizer(model_ckpt):
|
51 |
return AutoTokenizer.from_pretrained(model_ckpt)
|
52 |
|
53 |
+
@st.cache_resource
|
54 |
def load_model(model_ckpt):
|
55 |
model = AutoModelForCausalLM.from_pretrained(model_ckpt)
|
56 |
return model
|