Spaces:
Build error
Build error
fix device logic
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ def load_examples():
|
|
| 18 |
|
| 19 |
st.set_page_config(page_icon=':parrot:', layout="wide")
|
| 20 |
|
| 21 |
-
device =
|
| 22 |
device_name = "GPU" if torch.cuda.is_available() else "CPU"
|
| 23 |
model_ckpt = "lvwerra/codeparrot"
|
| 24 |
pipe = load_pipeline(model_ckpt, device)
|
|
|
|
| 18 |
|
| 19 |
st.set_page_config(page_icon=':parrot:', layout="wide")
|
| 20 |
|
| 21 |
+
device = 0 if torch.cuda.is_available() else -1
|
| 22 |
device_name = "GPU" if torch.cuda.is_available() else "CPU"
|
| 23 |
model_ckpt = "lvwerra/codeparrot"
|
| 24 |
pipe = load_pipeline(model_ckpt, device)
|