Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import time
|
3 |
import streamlit as st
|
4 |
from PIL import Image as PILImage
|
@@ -183,36 +184,6 @@ def format_prompt_inputs(image_collection, text_collection, video_collection, us
|
|
183 |
|
184 |
return inputs
|
185 |
|
186 |
-
import streamlit as st
|
187 |
-
import zipfile
|
188 |
-
import os
|
189 |
-
import time
|
190 |
-
|
191 |
-
def unzip_file(zip_path, extract_to):
|
192 |
-
"""
|
193 |
-
Unzips a zip file to the specified directory.
|
194 |
-
|
195 |
-
Args:
|
196 |
-
zip_path (str): Path to the zip file.
|
197 |
-
extract_to (str): Directory where the contents should be extracted.
|
198 |
-
"""
|
199 |
-
try:
|
200 |
-
# Ensure the destination directory exists
|
201 |
-
os.makedirs(extract_to, exist_ok=True)
|
202 |
-
|
203 |
-
# Open the zip file
|
204 |
-
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
205 |
-
# Extract all the contents
|
206 |
-
zip_ref.extractall(extract_to)
|
207 |
-
return True
|
208 |
-
except Exception as e:
|
209 |
-
print(f"An error occurred: {e}")
|
210 |
-
return False
|
211 |
-
import streamlit as st
|
212 |
-
import zipfile
|
213 |
-
import os
|
214 |
-
import time
|
215 |
-
|
216 |
def unzip_file(zip_path, extract_to):
|
217 |
"""
|
218 |
Unzips a zip file to the specified directory.
|
|
|
1 |
import os
|
2 |
+
import zipfile
|
3 |
import time
|
4 |
import streamlit as st
|
5 |
from PIL import Image as PILImage
|
|
|
184 |
|
185 |
return inputs
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
def unzip_file(zip_path, extract_to):
|
188 |
"""
|
189 |
Unzips a zip file to the specified directory.
|