Update app.py
Browse files
app.py
CHANGED
|
@@ -108,8 +108,7 @@ def initialize_min_dalle():
|
|
| 108 |
device='cpu'
|
| 109 |
)
|
| 110 |
|
| 111 |
-
|
| 112 |
-
min_dalle_model = initialize_min_dalle()
|
| 113 |
|
| 114 |
|
| 115 |
|
|
@@ -155,6 +154,11 @@ def generate_image_with_min_dalle(
|
|
| 155 |
from pydub import AudioSegment
|
| 156 |
import os
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
# Function to generate video from text
|
| 159 |
def get_output_video(text):
|
| 160 |
print("DEBUG: Starting get_output_video function...")
|
|
@@ -193,7 +197,7 @@ def get_output_video(text):
|
|
| 193 |
image.save(image_path)
|
| 194 |
print(f"DEBUG: Image generated and saved to {image_path}")
|
| 195 |
|
| 196 |
-
del min_dalle_model
|
| 197 |
torch.cuda.empty_cache()
|
| 198 |
gc.collect()
|
| 199 |
|
|
|
|
| 108 |
device='cpu'
|
| 109 |
)
|
| 110 |
|
| 111 |
+
|
|
|
|
| 112 |
|
| 113 |
|
| 114 |
|
|
|
|
| 154 |
from pydub import AudioSegment
|
| 155 |
import os
|
| 156 |
|
| 157 |
+
|
| 158 |
+
# Initialize MinDalle Model
|
| 159 |
+
min_dalle_model = initialize_min_dalle()
|
| 160 |
+
|
| 161 |
+
|
| 162 |
# Function to generate video from text
|
| 163 |
def get_output_video(text):
|
| 164 |
print("DEBUG: Starting get_output_video function...")
|
|
|
|
| 197 |
image.save(image_path)
|
| 198 |
print(f"DEBUG: Image generated and saved to {image_path}")
|
| 199 |
|
| 200 |
+
#del min_dalle_model
|
| 201 |
torch.cuda.empty_cache()
|
| 202 |
gc.collect()
|
| 203 |
|