Gbssreejith commited on
Commit
7908bd6
1 Parent(s): 02dd737

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -348,7 +348,7 @@ class GPT2Config(object):
348
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
349
  config = GPT2Config()
350
  model = GPT2LMHeadModel(config)
351
- state_dict = torch.load(r'C:\vision_model\gpt-2-Pytorch\test\gpt_today\weights\epoch_1.pth', map_location='cpu' if not torch.cuda.is_available() else None)
352
  model = load_weight(model, state_dict)
353
  model.to(device)
354
  print(model)
 
348
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
349
  config = GPT2Config()
350
  model = GPT2LMHeadModel(config)
351
+ state_dict = torch.load(r'epoch_5.pth', map_location='cpu' if not torch.cuda.is_available() else None)
352
  model = load_weight(model, state_dict)
353
  model.to(device)
354
  print(model)