Spaces:
Sleeping
Sleeping
Update app_concurrent.py
Browse files- app_concurrent.py +2 -3
app_concurrent.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
from flask import Flask, request, jsonify, Response, stream_with_context
|
2 |
-
import torch
|
3 |
import shutil
|
4 |
import os
|
5 |
import sys
|
@@ -391,6 +390,7 @@ def split_audio(audio_path, chunk_duration=5):
|
|
391 |
|
392 |
|
393 |
def process_video_for_chunk_sync(audio_chunk_path, args_dict, chunk_index):
|
|
|
394 |
"""
|
395 |
Synchronous function to process a video chunk. This will be submitted to concurrent.futures ProcessPoolExecutor.
|
396 |
"""
|
@@ -517,8 +517,7 @@ def generate_video():
|
|
517 |
'still': still,
|
518 |
'preprocess': preprocess,
|
519 |
'ref_pose_video_path': ref_pose_video_path,
|
520 |
-
'image_hardcoded': image_hardcoded
|
521 |
-
'device': 'cuda' if torch.cuda.is_available() else 'cpu'}
|
522 |
|
523 |
executor = concurrent.futures.ProcessPoolExecutor(max_workers=MAX_WORKERS)
|
524 |
try:
|
|
|
1 |
from flask import Flask, request, jsonify, Response, stream_with_context
|
|
|
2 |
import shutil
|
3 |
import os
|
4 |
import sys
|
|
|
390 |
|
391 |
|
392 |
def process_video_for_chunk_sync(audio_chunk_path, args_dict, chunk_index):
|
393 |
+
import torch
|
394 |
"""
|
395 |
Synchronous function to process a video chunk. This will be submitted to concurrent.futures ProcessPoolExecutor.
|
396 |
"""
|
|
|
517 |
'still': still,
|
518 |
'preprocess': preprocess,
|
519 |
'ref_pose_video_path': ref_pose_video_path,
|
520 |
+
'image_hardcoded': image_hardcoded}
|
|
|
521 |
|
522 |
executor = concurrent.futures.ProcessPoolExecutor(max_workers=MAX_WORKERS)
|
523 |
try:
|