Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,10 +48,14 @@ def generate_image(prompt,
|
|
| 48 |
|
| 49 |
if model_choice == "14B":
|
| 50 |
pipe = pipe_14b
|
| 51 |
-
pipe_2b
|
|
|
|
|
|
|
|
|
|
| 52 |
else:
|
| 53 |
pipe = pipe_2b
|
| 54 |
-
pipe_14b
|
|
|
|
| 55 |
|
| 56 |
if randomize_seed:
|
| 57 |
actual_seed = random.randint(0, 1000000)
|
|
|
|
| 48 |
|
| 49 |
if model_choice == "14B":
|
| 50 |
pipe = pipe_14b
|
| 51 |
+
del pipe_2b
|
| 52 |
+
torch.cuda.empty_cache()
|
| 53 |
+
|
| 54 |
+
|
| 55 |
else:
|
| 56 |
pipe = pipe_2b
|
| 57 |
+
del pipe_14b
|
| 58 |
+
torch.cuda.empty_cache()
|
| 59 |
|
| 60 |
if randomize_seed:
|
| 61 |
actual_seed = random.randint(0, 1000000)
|