Update app.py
Browse files
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
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
#
|
21 |
-
if os.path.
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
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
|