Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
ZennyKenny
commited on
add gpu support
Browse files
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 |
|