Vasudevakrishna commited on
Commit
3da7faa
1 Parent(s): 382b5f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -24,6 +24,7 @@ model.eval()
24
  def generate(text, max_length):
25
  enc = tiktoken.get_encoding("gpt2")
26
  tokens = enc.encode(text)
 
27
  tokens = torch.tensor(tokens, dtype= torch.long) # (len,) #check tiktoken app
28
  tokens = tokens.unsqueeze(0).repeat(num_return_sequences, 1) # (1, len)
29
  x = tokens.to(device)
 
24
  def generate(text, max_length):
25
  enc = tiktoken.get_encoding("gpt2")
26
  tokens = enc.encode(text)
27
+ tokens = torch.tensor(tokens)
28
  tokens = torch.tensor(tokens, dtype= torch.long) # (len,) #check tiktoken app
29
  tokens = tokens.unsqueeze(0).repeat(num_return_sequences, 1) # (1, len)
30
  x = tokens.to(device)