Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,13 @@
|
|
| 1 |
import os
|
| 2 |
-
if os.environ.get("SPACES_ZERO_GPU") is not None:
|
| 3 |
-
|
| 4 |
-
else:
|
| 5 |
-
class spaces:
|
| 6 |
-
@staticmethod
|
| 7 |
-
def GPU(func):
|
| 8 |
-
def wrapper(*args, **kwargs):
|
| 9 |
-
return func(*args, **kwargs)
|
| 10 |
-
return wrapper
|
| 11 |
-
|
| 12 |
import gradio as gr
|
| 13 |
import json
|
| 14 |
import logging
|
|
@@ -41,10 +40,10 @@ from transformers import CLIPModel, CLIPProcessor, CLIPTextModel, CLIPTokenizer,
|
|
| 41 |
import gc
|
| 42 |
import warnings
|
| 43 |
model_path = snapshot_download(repo_id="nyanko7/flux-dev-de-distill")
|
| 44 |
-
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
| 45 |
-
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
| 46 |
-
os.environ["HF_HUB_CACHE"] = cache_path
|
| 47 |
-
os.environ["HF_HOME"] = cache_path
|
| 48 |
|
| 49 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 50 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
#if os.environ.get("SPACES_ZERO_GPU") is not None:
|
| 3 |
+
import spaces
|
| 4 |
+
#else:
|
| 5 |
+
# class spaces:
|
| 6 |
+
# @staticmethod
|
| 7 |
+
# def GPU(func):
|
| 8 |
+
# def wrapper(*args, **kwargs):
|
| 9 |
+
# return func(*args, **kwargs)
|
| 10 |
+
# return wrapper
|
|
|
|
| 11 |
import gradio as gr
|
| 12 |
import json
|
| 13 |
import logging
|
|
|
|
| 40 |
import gc
|
| 41 |
import warnings
|
| 42 |
model_path = snapshot_download(repo_id="nyanko7/flux-dev-de-distill")
|
| 43 |
+
#cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
| 44 |
+
#os.environ["TRANSFORMERS_CACHE"] = cache_path
|
| 45 |
+
#os.environ["HF_HUB_CACHE"] = cache_path
|
| 46 |
+
#os.environ["HF_HOME"] = cache_path
|
| 47 |
|
| 48 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 49 |
|