dgjx commited on
Commit
3a05353
·
verified ·
1 Parent(s): 08343a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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,