irotem98 commited on
Commit
7e693ff
Β·
verified Β·
1 Parent(s): 241af22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -9,17 +9,22 @@ if not os.path.exists("edge_vlm"):
9
  # Install the required dependencies
10
  subprocess.run(["pip", "install", "-r", "edge_vlm/requirements.txt"])
11
 
12
- # Copy all files from edge_vlm to the current directory
13
  source_dir = "edge_vlm"
14
  destination_dir = "."
15
 
16
- for filename in os.listdir(source_dir):
17
- source_file = os.path.join(source_dir, filename)
18
- destination_file = os.path.join(destination_dir, filename)
19
-
20
- # Copy files, skipping directories like .git
21
- if os.path.isfile(source_file):
22
- shutil.copy(source_file, destination_file)
 
 
 
 
 
23
 
24
  # Now import the model from the copied files
25
  from model import MoondreamModel
 
9
  # Install the required dependencies
10
  subprocess.run(["pip", "install", "-r", "edge_vlm/requirements.txt"])
11
 
12
+ # Copy all files and folders from edge_vlm to the current directory
13
  source_dir = "edge_vlm"
14
  destination_dir = "."
15
 
16
+ for item in os.listdir(source_dir):
17
+ source_item = os.path.join(source_dir, item)
18
+ destination_item = os.path.join(destination_dir, item)
19
+
20
+ # If it's a directory, copy it recursively
21
+ if os.path.isdir(source_item):
22
+ if os.path.exists(destination_item):
23
+ shutil.rmtree(destination_item) # Remove if it already exists
24
+ shutil.copytree(source_item, destination_item)
25
+ else:
26
+ # If it's a file, copy it
27
+ shutil.copy(source_item, destination_item)
28
 
29
  # Now import the model from the copied files
30
  from model import MoondreamModel