ZennyKenny commited on
Commit
5f36451
·
verified ·
1 Parent(s): 4f5e819

add gpu support

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
2
  import torch
3
  from transformers import pipeline
4
 
 
 
5
  # Check if GPU is available; fallback to CPU if not
6
  device = 0 if torch.cuda.is_available() else -1
7
 
 
2
  import torch
3
  from transformers import pipeline
4
 
5
+ @spaces.GPU(duration=60)
6
+
7
  # Check if GPU is available; fallback to CPU if not
8
  device = 0 if torch.cuda.is_available() else -1
9