Spaces:
Runtime error
Runtime error
YongLD
commited on
Commit
·
b0178d6
1
Parent(s):
569f548
add app.py
Browse files
app.py
CHANGED
@@ -19,16 +19,16 @@ def filename_from_text(text: str) -> str:
|
|
19 |
def log_gpu_memory():
|
20 |
print(subprocess.check_output('nvidia-smi').decode('utf-8'))
|
21 |
|
22 |
-
log_gpu_memory()
|
23 |
|
24 |
model = MinDalle(
|
25 |
is_mega=True,
|
26 |
is_reusable=True,
|
27 |
-
device='
|
28 |
-
dtype=torch.float32
|
29 |
)
|
30 |
|
31 |
-
log_gpu_memory()
|
32 |
|
33 |
def run_model(
|
34 |
text: str,
|
@@ -147,13 +147,15 @@ with demo:
|
|
147 |
|
148 |
gradio.Markdown(
|
149 |
"""
|
150 |
-
####
|
151 |
- **Input Text**: For long prompts, only the first 64 text tokens will be used to generate the image.
|
152 |
- **Grid Size**: Size of the image grid. 3x3 takes about 15 seconds.
|
153 |
- **Seamless**: Tile images in image token space instead of pixel space.
|
154 |
- **Temperature**: High temperature increases the probability of sampling low scoring image tokens.
|
155 |
- **Top-k**: Each image token is sampled from the top-k scoring tokens.
|
156 |
- **Super Condition**: Higher values can result in better agreement with the text.
|
|
|
|
|
157 |
"""
|
158 |
)
|
159 |
|
|
|
19 |
def log_gpu_memory():
|
20 |
print(subprocess.check_output('nvidia-smi').decode('utf-8'))
|
21 |
|
22 |
+
# log_gpu_memory()
|
23 |
|
24 |
model = MinDalle(
|
25 |
is_mega=True,
|
26 |
is_reusable=True,
|
27 |
+
device='cpu',
|
28 |
+
# dtype=torch.float32
|
29 |
)
|
30 |
|
31 |
+
# log_gpu_memory()
|
32 |
|
33 |
def run_model(
|
34 |
text: str,
|
|
|
147 |
|
148 |
gradio.Markdown(
|
149 |
"""
|
150 |
+
#### Parameter
|
151 |
- **Input Text**: For long prompts, only the first 64 text tokens will be used to generate the image.
|
152 |
- **Grid Size**: Size of the image grid. 3x3 takes about 15 seconds.
|
153 |
- **Seamless**: Tile images in image token space instead of pixel space.
|
154 |
- **Temperature**: High temperature increases the probability of sampling low scoring image tokens.
|
155 |
- **Top-k**: Each image token is sampled from the top-k scoring tokens.
|
156 |
- **Super Condition**: Higher values can result in better agreement with the text.
|
157 |
+
|
158 |
+
####
|
159 |
"""
|
160 |
)
|
161 |
|