Spaces:
Sleeping
Sleeping
Add init checks
Browse files
app.py
CHANGED
@@ -15,10 +15,33 @@ OUT_PPT_NAME= PPTX_DEST
|
|
15 |
NO_IMAGES = False
|
16 |
QUESTIONS = 5
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
def gradio_run(
|
19 |
video_id, chunk_size: int,
|
20 |
no_images: bool, no_chapters: bool, out_type="pdf"):
|
21 |
|
|
|
|
|
|
|
22 |
VIDEO_ID = video_id
|
23 |
CHUNK_SIZE = chunk_size
|
24 |
NO_IMAGES = no_images
|
|
|
15 |
NO_IMAGES = False
|
16 |
QUESTIONS = 5
|
17 |
|
18 |
+
def init_check():
|
19 |
+
# check for google-chrome
|
20 |
+
if os.system("google-chrome --version") != 0:
|
21 |
+
logger.critical("Google Chrome is not installed")
|
22 |
+
# raise Exception("Google Chrome is not installed")
|
23 |
+
|
24 |
+
if os.system("npm --version") != 0:
|
25 |
+
logger.critical("npm is not installed")
|
26 |
+
# raise Exception("npm is not installed")
|
27 |
+
|
28 |
+
if os.system("npx --version") != 0:
|
29 |
+
logger.critical("npx is not installed")
|
30 |
+
# raise Exception("npx is not installed")
|
31 |
+
|
32 |
+
if os.system("ffmpeg --version") != 0:
|
33 |
+
logger.critical("ffmpeg is not installed")
|
34 |
+
# raise Exception("ffmpeg is not installed")
|
35 |
+
|
36 |
+
logger.info("Init check done, look for errors above..")
|
37 |
+
|
38 |
def gradio_run(
|
39 |
video_id, chunk_size: int,
|
40 |
no_images: bool, no_chapters: bool, out_type="pdf"):
|
41 |
|
42 |
+
# do init check
|
43 |
+
init_check()
|
44 |
+
|
45 |
VIDEO_ID = video_id
|
46 |
CHUNK_SIZE = chunk_size
|
47 |
NO_IMAGES = no_images
|