mrfakename commited on
Commit
8649cae
1 Parent(s): acec2c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import subprocess, os, shutil, time, sys, platform
2
  if platform.system() == 'Windows':
3
  raise SystemError("You are trying to run this demo on **Windows**. Windows is not supported. If you would still like to try, remove lines 2 & 3 in the code to bypass this warning.")
4
 
@@ -8,7 +8,9 @@ def setup_virtual_env():
8
 
9
  # Activate the virtual environment
10
  activate_script = os.path.join('venv_ui', 'bin', 'activate')
11
- subprocess.run(['chmod', '+x', activate_script], shell=True)
 
 
12
  subprocess.run([activate_script], shell=True)
13
 
14
  # Install required packages
@@ -35,8 +37,8 @@ def move_files_and_subdirs(source_dir):
35
 
36
  subprocess.run(['git', 'clone', 'https://github.com/fakerybakery/metavoice-src', './mvsrc'])
37
  time.sleep(3)
38
- subprocess.run(['pip', 'uninstall', '-y', 'pydantic'])
39
- subprocess.run(['pip', 'install', '-U', 'pydantic==1.7.4'])
40
  move_files_and_subdirs("mvsrc")
41
  time.sleep(3)
42
  serving = subprocess.Popen(['python', 'fam/llm/serving.py', '--huggingface_repo_id', 'metavoiceio/metavoice-1B-v0.1'])
 
1
+ import subprocess, os, shutil, time, sys, platform, stat
2
  if platform.system() == 'Windows':
3
  raise SystemError("You are trying to run this demo on **Windows**. Windows is not supported. If you would still like to try, remove lines 2 & 3 in the code to bypass this warning.")
4
 
 
8
 
9
  # Activate the virtual environment
10
  activate_script = os.path.join('venv_ui', 'bin', 'activate')
11
+
12
+ st = os.stat(activate_script)
13
+ os.chmod(activate_script, st.st_mode | stat.S_IEXEC)
14
  subprocess.run([activate_script], shell=True)
15
 
16
  # Install required packages
 
37
 
38
  subprocess.run(['git', 'clone', 'https://github.com/fakerybakery/metavoice-src', './mvsrc'])
39
  time.sleep(3)
40
+ subprocess.run(['pip', 'uninstall', '-y', 'pydantic', 'fastapi'])
41
+ subprocess.run(['pip', 'install', '-U', 'pydantic==2.6.1', 'fastapi'])
42
  move_files_and_subdirs("mvsrc")
43
  time.sleep(3)
44
  serving = subprocess.Popen(['python', 'fam/llm/serving.py', '--huggingface_repo_id', 'metavoiceio/metavoice-1B-v0.1'])