Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import re
|
|
| 8 |
import tempfile
|
| 9 |
import ast
|
| 10 |
import html
|
|
|
|
| 11 |
from threading import Thread
|
| 12 |
from typing import Iterable, Optional
|
| 13 |
|
|
@@ -28,17 +29,6 @@ from transformers import (
|
|
| 28 |
from gradio.themes import Soft
|
| 29 |
from gradio.themes.utils import colors, fonts, sizes
|
| 30 |
|
| 31 |
-
# --- Environment & GPU Setup ---
|
| 32 |
-
try:
|
| 33 |
-
import spaces
|
| 34 |
-
except ImportError:
|
| 35 |
-
class spaces:
|
| 36 |
-
@staticmethod
|
| 37 |
-
def GPU(func):
|
| 38 |
-
def wrapper(*args, **kwargs):
|
| 39 |
-
return func(*args, **kwargs)
|
| 40 |
-
return wrapper
|
| 41 |
-
|
| 42 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 43 |
print(f"✅ Using device: {device}")
|
| 44 |
|
|
|
|
| 8 |
import tempfile
|
| 9 |
import ast
|
| 10 |
import html
|
| 11 |
+
import spaces
|
| 12 |
from threading import Thread
|
| 13 |
from typing import Iterable, Optional
|
| 14 |
|
|
|
|
| 29 |
from gradio.themes import Soft
|
| 30 |
from gradio.themes.utils import colors, fonts, sizes
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 33 |
print(f"✅ Using device: {device}")
|
| 34 |
|