Norod78 commited on
Commit
87cca9a
โ€ข
1 Parent(s): 0b80303

cache_resource

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -16,7 +16,7 @@ os.environ["TOKENIZERS_PARALLELISM"] = "false"
16
  random.seed(None)
17
  suggested_text_list = ['ืคืขื ืื—ืช, ืœืคื ื™ ืฉื ื™ื ืจื‘ื•ืช','ืฉืœื•ื, ืงื•ืจืื™ื ืœื™ ื“ื•ืจื•ืŸ ื•ืื ื™','ื‘ื•ืงืจ ื˜ื•ื‘ ืœื›ื•ืœื','ื•ืื– ื”ืคืจืชื™ ืืช ื›ืœ ื›ืœืœื™ ื”ื˜ืงืก ื›ืฉ']
18
 
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)
 
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)