Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ suggested_text_list = ['ืืืจืช ืืืจืืื']
|
|
19 |
@st.cache(hash_funcs={tokenizers.Tokenizer: id, tokenizers.AddedToken: id})
|
20 |
def load_model(model_name):
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
23 |
return model, tokenizer
|
24 |
|
25 |
def extend(input_text, max_size=20, top_k=50, top_p=0.95):
|
|
|
19 |
@st.cache(hash_funcs={tokenizers.Tokenizer: id, tokenizers.AddedToken: id})
|
20 |
def load_model(model_name):
|
21 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
22 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, low_cpu_mem_usage=True)
|
23 |
return model, tokenizer
|
24 |
|
25 |
def extend(input_text, max_size=20, top_k=50, top_p=0.95):
|