Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,7 @@ async def upload_file(
|
|
35 |
print(f"Received: chunkIndex={chunkIndex}, totalChunks={totalChunks}, fileName={fileName}, directory={directory}")
|
36 |
# Create the directory if it doesn't exist
|
37 |
target_dir = Path(UPLOAD_DIR) / directory
|
|
|
38 |
target_dir.mkdir(parents=True, exist_ok=True)
|
39 |
|
40 |
# Save the chunk
|
@@ -247,6 +248,8 @@ async def predict_action(uuid: str):
|
|
247 |
print("##### predict-action started #####")
|
248 |
# Définir le répertoire cible
|
249 |
target_dir = Path(UPLOAD_DIR) / uuid
|
|
|
|
|
250 |
# Chercher le fichier vidéo dans le répertoire
|
251 |
video_extensions = {".mp4", ".avi", ".mkv", ".mov", ".flv", ".wmv", ".webm"} # Liste des extensions vidéo courantes
|
252 |
# Trouver le fichier vidéo (s'il n'y en a qu'un dans le répertoire)
|
|
|
35 |
print(f"Received: chunkIndex={chunkIndex}, totalChunks={totalChunks}, fileName={fileName}, directory={directory}")
|
36 |
# Create the directory if it doesn't exist
|
37 |
target_dir = Path(UPLOAD_DIR) / directory
|
38 |
+
target_dir = target_dir.absolute() # Get the absolute path
|
39 |
target_dir.mkdir(parents=True, exist_ok=True)
|
40 |
|
41 |
# Save the chunk
|
|
|
248 |
print("##### predict-action started #####")
|
249 |
# Définir le répertoire cible
|
250 |
target_dir = Path(UPLOAD_DIR) / uuid
|
251 |
+
target_dir = target_dir.absolute() # Get the absolute path
|
252 |
+
|
253 |
# Chercher le fichier vidéo dans le répertoire
|
254 |
video_extensions = {".mp4", ".avi", ".mkv", ".mov", ".flv", ".wmv", ".webm"} # Liste des extensions vidéo courantes
|
255 |
# Trouver le fichier vidéo (s'il n'y en a qu'un dans le répertoire)
|