Spaces:
Sleeping
Sleeping
JiaenLiu
commited on
Commit
·
ddd11b0
1
Parent(s):
96fb84a
small fix
Browse filesFormer-commit-id: 9c51a989e2c42774a4f1f5b81bc5391f55adead6
- pipeline.py +5 -2
pipeline.py
CHANGED
@@ -22,7 +22,7 @@ parser.add_argument("-v", help="auto encode script with video", action='store_tr
|
|
22 |
args = parser.parse_args()
|
23 |
|
24 |
# input should be either video file or youtube video link.
|
25 |
-
if args.link is None and args.video_file is None and args.srt_file is None:
|
26 |
print("need video source or srt file")
|
27 |
exit()
|
28 |
|
@@ -49,6 +49,8 @@ if args.video_name == 'placeholder' :
|
|
49 |
VIDEO_NAME = args.srt_file.split('/')[-1].split('.')[0]
|
50 |
else:
|
51 |
VIDEO_NAME = args.video_name
|
|
|
|
|
52 |
|
53 |
model_name = args.model_name
|
54 |
|
@@ -87,7 +89,8 @@ if args.link is not None and args.video_file is None:
|
|
87 |
elif args.video_file is not None:
|
88 |
# Read from local
|
89 |
video_path = args.video_file
|
90 |
-
|
|
|
91 |
audio_file= open(args.audio_file, "rb")
|
92 |
audio_path = args.audio_file
|
93 |
else:
|
|
|
22 |
args = parser.parse_args()
|
23 |
|
24 |
# input should be either video file or youtube video link.
|
25 |
+
if args.link is None and args.video_file is None and args.srt_file is None and args.audio_file is None:
|
26 |
print("need video source or srt file")
|
27 |
exit()
|
28 |
|
|
|
49 |
VIDEO_NAME = args.srt_file.split('/')[-1].split('.')[0]
|
50 |
else:
|
51 |
VIDEO_NAME = args.video_name
|
52 |
+
else:
|
53 |
+
VIDEO_NAME = args.video_name
|
54 |
|
55 |
model_name = args.model_name
|
56 |
|
|
|
89 |
elif args.video_file is not None:
|
90 |
# Read from local
|
91 |
video_path = args.video_file
|
92 |
+
audio_path = "{DOWNLOAD_PATH}/audio/{VIDEO_NAME}.mp3".format(DOWNLOAD_PATH, VIDEO_NAME)
|
93 |
+
if args.audio_file is not None or os.path.exists(audio_path):
|
94 |
audio_file= open(args.audio_file, "rb")
|
95 |
audio_path = args.audio_file
|
96 |
else:
|