fix runtime error for model.half()
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ def main(
|
|
74 |
model.config.bos_token_id = 1
|
75 |
model.config.eos_token_id = 2
|
76 |
|
77 |
-
if not load_8bit:
|
78 |
model.half() # seems to fix bugs for some users.
|
79 |
|
80 |
model.eval()
|
|
|
74 |
model.config.bos_token_id = 1
|
75 |
model.config.eos_token_id = 2
|
76 |
|
77 |
+
if not load_8bit and device != "cpu":
|
78 |
model.half() # seems to fix bugs for some users.
|
79 |
|
80 |
model.eval()
|