Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|