Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,8 @@ def givetext(input_text,lmodel,ltokenizer):
|
|
61 |
with torch.no_grad():
|
62 |
print("BEFORE RETURNING")
|
63 |
|
64 |
-
return (ltokenizer.decode(lmodel.generate(**model_input, max_new_tokens=1000)[0], skip_special_tokens=True))
|
|
|
65 |
#return (ltokenizer.decode(lmodel.generate(**model_input, max_new_tokens=100)[0], skip_special_tokens=True))
|
66 |
except Exception as error:
|
67 |
print("Exception {error}".format(error = error))
|
|
|
61 |
with torch.no_grad():
|
62 |
print("BEFORE RETURNING")
|
63 |
|
64 |
+
return (ltokenizer.decode(lmodel.generate(**model_input, max_new_tokens=1000, device="cpu")[0], skip_special_tokens=True))
|
65 |
+
#return (ltokenizer.decode(lmodel.generate(**model_input, max_new_tokens=1000)[0], skip_special_tokens=True))
|
66 |
#return (ltokenizer.decode(lmodel.generate(**model_input, max_new_tokens=100)[0], skip_special_tokens=True))
|
67 |
except Exception as error:
|
68 |
print("Exception {error}".format(error = error))
|