Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import random
|
|
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
import spaces
|
@@ -10,7 +11,7 @@ if not torch.cuda.is_available():
|
|
10 |
DESCRIPTION += "\n<p>你现在运行在CPU上 但是此项目只支持GPU.</p>"
|
11 |
|
12 |
MAX_SEED = np.iinfo(np.int32).max
|
13 |
-
CACHE_EXAMPLES = torch.cuda.is_available() and CACHE_EXAMPLES == "1"
|
14 |
MAX_IMAGE_SIZE = 4096
|
15 |
|
16 |
if torch.cuda.is_available():
|
|
|
1 |
import random
|
2 |
+
import os
|
3 |
import gradio as gr
|
4 |
import numpy as np
|
5 |
import spaces
|
|
|
11 |
DESCRIPTION += "\n<p>你现在运行在CPU上 但是此项目只支持GPU.</p>"
|
12 |
|
13 |
MAX_SEED = np.iinfo(np.int32).max
|
14 |
+
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "1") == "1"
|
15 |
MAX_IMAGE_SIZE = 4096
|
16 |
|
17 |
if torch.cuda.is_available():
|