cache_resource
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
|
16 |
random.seed(None)
|
17 |
suggested_text_list = ['ืคืขื ืืืช, ืืคื ื ืฉื ืื ืจืืืช','ืฉืืื, ืงืืจืืื ืื ืืืจืื ืืื ื','ืืืงืจ ืืื ืืืืื','ืืื ืืคืจืชื ืืช ืื ืืืื ืืืงืก ืืฉ']
|
18 |
|
19 |
-
@st.
|
20 |
def load_model(model_name):
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
|
16 |
random.seed(None)
|
17 |
suggested_text_list = ['ืคืขื ืืืช, ืืคื ื ืฉื ืื ืจืืืช','ืฉืืื, ืงืืจืืื ืื ืืืจืื ืืื ื','ืืืงืจ ืืื ืืืืื','ืืื ืืคืจืชื ืืช ืื ืืืื ืืืงืก ืืฉ']
|
18 |
|
19 |
+
@st.cache_resource
|
20 |
def load_model(model_name):
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|