zman1x1 commited on
Commit
050bb7a
1 Parent(s): e287ef7

resolv chrome independently

Browse files
Files changed (4) hide show
  1. app.py +4 -4
  2. packages.txt +0 -1
  3. scripts/chrome-setup.sh +4 -0
  4. setup.sh +0 -3
app.py CHANGED
@@ -19,19 +19,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
 
@@ -170,6 +169,7 @@ def gradio_run(
170
  return os.path.abspath(OUT_PPT_NAME)
171
 
172
  def gradio_Interface():
 
173
  app = gr.Interface(
174
  fn=gradio_run,
175
  inputs=[
 
19
  # check for google-chrome
20
  if os.system("google-chrome --version") != 0:
21
  logger.critical("Google Chrome is not installed")
22
+ if os.path.exists("scripts/chrome-setup.sh"):
23
+ logger.info("Trying to install chrome..")
24
+ os.system("bash scripts/chrome-setup.sh")
25
 
26
  if os.system("npm --version") != 0:
27
  logger.critical("npm is not installed")
 
28
 
29
  if os.system("npx --version") != 0:
30
  logger.critical("npx is not installed")
 
31
 
32
  if os.system("ffmpeg --version") != 0:
33
  logger.critical("ffmpeg is not installed")
 
34
 
35
  logger.info("Init check done, look for errors above..")
36
 
 
169
  return os.path.abspath(OUT_PPT_NAME)
170
 
171
  def gradio_Interface():
172
+ init_check()
173
  app = gr.Interface(
174
  fn=gradio_run,
175
  inputs=[
packages.txt CHANGED
@@ -1,3 +1,2 @@
1
  nodejs
2
  npm
3
- chromium-browser
 
1
  nodejs
2
  npm
 
scripts/chrome-setup.sh ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
4
+ sudo dpkg -i google-chrome-stable_current_amd64.deb
setup.sh CHANGED
@@ -3,6 +3,3 @@
3
  sudo apt-get update
4
  sudo apt-get install -y nodejs npm
5
  sudo npm i -g @marp-team/marp-cli
6
- sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
7
- sudo dpkg -i google-chrome-stable_current_amd64.deb
8
-
 
3
  sudo apt-get update
4
  sudo apt-get install -y nodejs npm
5
  sudo npm i -g @marp-team/marp-cli