Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -10,17 +10,17 @@ from typing import List
|
|
10 |
import shutil
|
11 |
import numpy as np
|
12 |
import random
|
13 |
-
|
14 |
# Ensure `spaces` is imported first
|
15 |
-
try:
|
16 |
-
import spaces
|
17 |
-
except ImportError:
|
18 |
-
class spaces:
|
19 |
-
@staticmethod
|
20 |
-
def GPU(func=None, duration=None):
|
21 |
-
def wrapper(fn):
|
22 |
-
return fn
|
23 |
-
return wrapper if func is None else wrapper(func)
|
24 |
|
25 |
# Now import CUDA-related libraries
|
26 |
import torch
|
@@ -113,7 +113,7 @@ def check_gpu_availability():
|
|
113 |
else:
|
114 |
print("CUDA is not available. Running on CPU.")
|
115 |
|
116 |
-
check_gpu_availability()
|
117 |
|
118 |
#@spaces.GPU()
|
119 |
def generate_image_with_flux_old(
|
|
|
10 |
import shutil
|
11 |
import numpy as np
|
12 |
import random
|
13 |
+
import spaces
|
14 |
# Ensure `spaces` is imported first
|
15 |
+
#try:
|
16 |
+
# import spaces
|
17 |
+
#except ImportError:
|
18 |
+
# class spaces:
|
19 |
+
# @staticmethod
|
20 |
+
# def GPU(func=None, duration=None):
|
21 |
+
# def wrapper(fn):
|
22 |
+
# return fn
|
23 |
+
# return wrapper if func is None else wrapper(func)
|
24 |
|
25 |
# Now import CUDA-related libraries
|
26 |
import torch
|
|
|
113 |
else:
|
114 |
print("CUDA is not available. Running on CPU.")
|
115 |
|
116 |
+
#check_gpu_availability()
|
117 |
|
118 |
#@spaces.GPU()
|
119 |
def generate_image_with_flux_old(
|