Tonic commited on
Commit
78fb08c
1 Parent(s): b9614d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -29,6 +29,7 @@ def generate_text(usertitle, content, temperature, max_length, N=3):
29
 
30
  def score(sequence):
31
  inputs = rm_tokenizer(sequence, return_tensors='pt', padding=True, truncation=True, max_length=512).to('cuda')
 
32
  with torch.no_grad():
33
  outputs = rm_model(**inputs)
34
  logits = outputs.logits
 
29
 
30
  def score(sequence):
31
  inputs = rm_tokenizer(sequence, return_tensors='pt', padding=True, truncation=True, max_length=512).to('cuda')
32
+ inputs = {k: v.to('cuda') for k, v in inputs.items()}
33
  with torch.no_grad():
34
  outputs = rm_model(**inputs)
35
  logits = outputs.logits