mrfakename commited on
Commit
636e13f
1 Parent(s): a564429

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -1,7 +1,29 @@
1
  import subprocess, os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  subprocess.run(['git', 'clone', 'https://github.com/metavoiceio/metavoice-src', './mvsrc'])
3
  subprocess.run(['sleep', '3'])
4
- subprocess.run(['cd', 'mvsrc'])
 
5
  print(subprocess.run(['ls']))
6
  # subprocess.run(['pip', 'install', '-r', 'requirements.txt'])
7
  serving = subprocess.Popen(['python', 'fam/llm/serving.py', '--huggingface_repo_id', 'metavoiceio/metavoice-1B-v0.1'])
 
1
  import subprocess, os
2
+ import shutil
3
+
4
+ def move_files_and_subdirs(source_dir):
5
+ # List all files and directories in the source directory
6
+ files_and_dirs = os.listdir(source_dir)
7
+
8
+ # Move each file and directory to the current working directory
9
+ for item in files_and_dirs:
10
+ # Get the full path of the item
11
+ src_path = os.path.join(source_dir, item)
12
+ # Check if it's a file
13
+ if os.path.isfile(src_path):
14
+ # Move the file to the current working directory
15
+ shutil.move(src_path, os.path.join(os.getcwd(), item))
16
+ elif os.path.isdir(src_path):
17
+ # Move the directory and its contents recursively to the current working directory
18
+ shutil.move(src_path, os.path.join(os.getcwd(), item))
19
+ else:
20
+ print(f"Ignoring: {src_path} as it is neither a file nor a directory")
21
+
22
+
23
  subprocess.run(['git', 'clone', 'https://github.com/metavoiceio/metavoice-src', './mvsrc'])
24
  subprocess.run(['sleep', '3'])
25
+ move_files_and_subdirs("mvsrc")
26
+
27
  print(subprocess.run(['ls']))
28
  # subprocess.run(['pip', 'install', '-r', 'requirements.txt'])
29
  serving = subprocess.Popen(['python', 'fam/llm/serving.py', '--huggingface_repo_id', 'metavoiceio/metavoice-1B-v0.1'])