nnsohamnn commited on
Commit
c0decd0
·
verified ·
1 Parent(s): a9bd10d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -6,8 +6,7 @@ import torch
6
  # Load tokenizer
7
  tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
8
  tokenizer.pad_token = tokenizer.eos_token
9
- model.load_state_dict(torch.load("Conv_GPT.pth", map_location=torch.device('cpu')))
10
- model.eval()
11
 
12
  # Load model
13
  model = TransformerModel(
@@ -17,6 +16,8 @@ model = TransformerModel(
17
  num_heads=16,
18
  dropout=0.1
19
  )
 
 
20
 
21
 
22
  # Define generation function
 
6
  # Load tokenizer
7
  tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
8
  tokenizer.pad_token = tokenizer.eos_token
9
+
 
10
 
11
  # Load model
12
  model = TransformerModel(
 
16
  num_heads=16,
17
  dropout=0.1
18
  )
19
+ model.load_state_dict(torch.load("Conv_GPT.pth", map_location=torch.device('cpu')))
20
+ model.eval()
21
 
22
 
23
  # Define generation function