Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,22 @@
|
|
| 1 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
from model import MoondreamModel
|
| 3 |
import torch
|
|
|
|
| 4 |
|
| 5 |
-
# Load the model and tokenizer
|
| 6 |
model = MoondreamModel.load_model()
|
| 7 |
tokenizer = MoondreamModel.load_tokenizer()
|
| 8 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
|
| 4 |
+
# Clone the repository if not already present
|
| 5 |
+
if not os.path.exists("edge_vlm"):
|
| 6 |
+
subprocess.run(["git", "clone", "https://huggingface.co/irotem98/edge_vlm"])
|
| 7 |
+
|
| 8 |
+
# Change directory to the cloned repository
|
| 9 |
+
os.chdir("edge_vlm")
|
| 10 |
+
|
| 11 |
+
# Install the required dependencies
|
| 12 |
+
subprocess.run(["pip", "install", "-r", "requirements.txt"])
|
| 13 |
+
|
| 14 |
+
# Now import the model from the cloned repository
|
| 15 |
from model import MoondreamModel
|
| 16 |
import torch
|
| 17 |
+
import gradio as gr
|
| 18 |
|
| 19 |
+
# Load the model and tokenizer
|
| 20 |
model = MoondreamModel.load_model()
|
| 21 |
tokenizer = MoondreamModel.load_tokenizer()
|
| 22 |
|