Spaces:
Runtime error
Runtime error
Specify mega weights
Browse files
app.py
CHANGED
|
@@ -46,13 +46,13 @@ model = MinDalle(
|
|
| 46 |
models_root='./pretrained',
|
| 47 |
dtype=float32,
|
| 48 |
device='cpu',
|
| 49 |
-
is_mega=
|
| 50 |
is_reusable=True
|
| 51 |
)
|
| 52 |
|
| 53 |
|
| 54 |
def gen_image(prompt):
|
| 55 |
-
torch.set_grad_enabled(False)
|
| 56 |
print(f'RUNNING gen_image with pronpt: {prompt}')
|
| 57 |
images = model.generate_images(
|
| 58 |
text=prompt,
|
|
|
|
| 46 |
models_root='./pretrained',
|
| 47 |
dtype=float32,
|
| 48 |
device='cpu',
|
| 49 |
+
is_mega=True,
|
| 50 |
is_reusable=True
|
| 51 |
)
|
| 52 |
|
| 53 |
|
| 54 |
def gen_image(prompt):
|
| 55 |
+
torch.set_grad_enabled(False) # Hugging Space faces seems to run out of memory if grads are not disabled
|
| 56 |
print(f'RUNNING gen_image with pronpt: {prompt}')
|
| 57 |
images = model.generate_images(
|
| 58 |
text=prompt,
|