Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,6 +47,7 @@ with st.form(key='my_form'):
|
|
| 47 |
submit_button = st.form_submit_button(label='Submit')
|
| 48 |
if submit_button:
|
| 49 |
with torch.no_grad():
|
|
|
|
| 50 |
outputs = model(prompt, labels=input_ids)
|
| 51 |
loss, logits = outputs[:2]
|
| 52 |
perplex = math.exp(loss)
|
|
|
|
| 47 |
submit_button = st.form_submit_button(label='Submit')
|
| 48 |
if submit_button:
|
| 49 |
with torch.no_grad():
|
| 50 |
+
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
| 51 |
outputs = model(prompt, labels=input_ids)
|
| 52 |
loss, logits = outputs[:2]
|
| 53 |
perplex = math.exp(loss)
|