orendar commited on
Commit
abae92c
โ€ข
1 Parent(s): 6ab66cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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):