Spaces:
Runtime error
Runtime error
Fixes an error when running on CPU mode. (#2)
Browse files- Fixes an error when running on CPU mode. (5653788477bae62b28187c8bc65912ae068eadf6)
Co-authored-by: Anton ANDREEV <toncho11@users.noreply.huggingface.co>
app.py
CHANGED
@@ -76,7 +76,8 @@ def generate_prompt(instruction, input=None):
|
|
76 |
|
77 |
### Response:"""
|
78 |
|
79 |
-
|
|
|
80 |
model.eval()
|
81 |
if torch.__version__ >= "2":
|
82 |
model = torch.compile(model)
|
|
|
76 |
|
77 |
### Response:"""
|
78 |
|
79 |
+
if device != "cpu":
|
80 |
+
model.half()
|
81 |
model.eval()
|
82 |
if torch.__version__ >= "2":
|
83 |
model = torch.compile(model)
|