vladyur commited on
Commit
5d2e6f5
1 Parent(s): 0549ecf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -10,7 +10,8 @@ from PIL import Image
10
  @st.cache(hash_funcs={tokenizers.Tokenizer: lambda _: None, tokenizers.AddedToken: lambda _: None, re.Pattern: lambda _: None}, allow_output_mutation=True, suppress_st_warning=True)
11
  def get_model(model_name, model_path='pytorch_model.bin'):
12
  tokenizer = transformers.GPT2Tokenizer.from_pretrained(model_name)
13
- model = transformers.OPTForCausalLM.from_pretrained('big-kek/NeuroSkeptic', device_map='cpu')
 
14
 
15
  model.eval()
16
  return model, tokenizer
 
10
  @st.cache(hash_funcs={tokenizers.Tokenizer: lambda _: None, tokenizers.AddedToken: lambda _: None, re.Pattern: lambda _: None}, allow_output_mutation=True, suppress_st_warning=True)
11
  def get_model(model_name, model_path='pytorch_model.bin'):
12
  tokenizer = transformers.GPT2Tokenizer.from_pretrained(model_name)
13
+ model = transformers.OPTForCausalLM.from_pretrained(model_name)
14
+ model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
15
 
16
  model.eval()
17
  return model, tokenizer