Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ The following SQL query best answers the question `{user_question}`:
|
|
| 26 |
```sql
|
| 27 |
"""
|
| 28 |
|
| 29 |
-
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 30 |
generated_ids = model.generate(
|
| 31 |
**inputs,
|
| 32 |
num_return_sequences=1,
|
|
|
|
| 26 |
```sql
|
| 27 |
"""
|
| 28 |
|
| 29 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda" if torch.cuda.is_available() else "cpu")
|
| 30 |
generated_ids = model.generate(
|
| 31 |
**inputs,
|
| 32 |
num_return_sequences=1,
|