selbl commited on
Commit
835c0d8
1 Parent(s): ae40d11

Update StreamlitModel.py

Browse files
Files changed (1) hide show
  1. StreamlitModel.py +1 -1
StreamlitModel.py CHANGED
@@ -105,7 +105,7 @@ def TextGeneration(prompt,prof=False,parts=True):
105
  gpt_model = GPT2_Model(configuration).to(device)
106
  #gpt_model.load_state_dict(torch.load('GPT-Trained-Model-Prod.pt'))
107
  state_dict = torch.hub.load_state_dict_from_url(r'https://github.com/Selbl/LyricGeneration/raw/main/GPT-Trained-Model-Prod.pt?download=',map_location=device)
108
- gpt_model.load_state_dict(state_dict,map_location=device)
109
  #Load tokenizer
110
  tokenizer = GPT2Tokenizer.from_pretrained('gpt2', pad_token='<|pad|>')
111
  #Call loader function
 
105
  gpt_model = GPT2_Model(configuration).to(device)
106
  #gpt_model.load_state_dict(torch.load('GPT-Trained-Model-Prod.pt'))
107
  state_dict = torch.hub.load_state_dict_from_url(r'https://github.com/Selbl/LyricGeneration/raw/main/GPT-Trained-Model-Prod.pt?download=',map_location=device)
108
+ gpt_model.load_state_dict(state_dict)
109
  #Load tokenizer
110
  tokenizer = GPT2Tokenizer.from_pretrained('gpt2', pad_token='<|pad|>')
111
  #Call loader function