Camil Ziane commited on
Commit
fcf0cff
·
1 Parent(s): c5c7f9e

init space

Browse files
Dockerfile CHANGED
@@ -1,18 +1,21 @@
1
  FROM python:3.10
2
 
 
 
 
 
 
3
  RUN useradd -m -u 1000 user
4
  USER user
5
  ENV PATH="/home/user/.local/bin:$PATH"
6
-
7
  WORKDIR /app
8
 
9
- RUN git clone https://huggingface.co/zcamz/tiny-llava-OpenELM-270M-Instruct-aimv2-large-patch14-224-distilled-elm_lora-finetune
 
10
 
11
  COPY --chown=user TinyLLaVA_Factory/pyproject.toml /app
12
-
13
  RUN pip install --upgrade pip # enable PEP 660 support
14
  RUN pip install -e .
15
-
16
  COPY --chown=user TinyLLaVA_Factory/ /app
17
 
18
- CMD ["python", "tinyllava/serve/app.py", "--model-path", "./tiny-llava-OpenELM-270M-Instruct-aimv2-large-patch14-224-distilled-elm_lora-finetune", "--port", "7860"]
 
1
  FROM python:3.10
2
 
3
+ RUN apt-get update && \
4
+ apt-get install -y git-lfs && \
5
+ rm -rf /var/lib/apt/lists/* && \
6
+ git lfs install
7
+
8
  RUN useradd -m -u 1000 user
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
 
11
  WORKDIR /app
12
 
13
+ RUN git lfs install && \
14
+ git clone https://huggingface.co/zcamz/tiny-llava-OpenELM-270M-Instruct-aimv2-large-patch14-224-distilled-elm_lora-finetune
15
 
16
  COPY --chown=user TinyLLaVA_Factory/pyproject.toml /app
 
17
  RUN pip install --upgrade pip # enable PEP 660 support
18
  RUN pip install -e .
 
19
  COPY --chown=user TinyLLaVA_Factory/ /app
20
 
21
+ CMD ["python", "-m", "tinyllava.serve.app", "--model-path", "./tiny-llava-OpenELM-270M-Instruct-aimv2-large-patch14-224-distilled-elm_lora-finetune", "--port", "7860"]
TinyLLaVA_Factory/tinyllava/model/configuration_tinyllava.py CHANGED
@@ -121,7 +121,7 @@ class TinyLlavaConfig(PretrainedConfig):
121
  )
122
 
123
  else:
124
- self.vision_config = AutoConfig.from_pretrained(self.vision_model_name_or_path.split(':')[-1])
125
  self.vision_config = getattr(self.vision_config, 'vision_config', self.vision_config)
126
  if vision_config is not None:
127
  self.vision_config = self.vision_config.from_dict(vision_config)
 
121
  )
122
 
123
  else:
124
+ self.vision_config = AutoConfig.from_pretrained(self.vision_model_name_or_path.split(':')[-1], trust_remote_code=True)
125
  self.vision_config = getattr(self.vision_config, 'vision_config', self.vision_config)
126
  if vision_config is not None:
127
  self.vision_config = self.vision_config.from_dict(vision_config)
TinyLLaVA_Factory/tinyllava/model/vision_tower/aimv2.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoModel, AutoImageProcessor
2
+
3
+ from . import register_vision_tower
4
+ from .base import VisionTower
5
+
6
+
7
+ @register_vision_tower('aimv2')
8
+ class AIMv2Tower(VisionTower):
9
+ def __init__(self, cfg):
10
+ super().__init__(cfg)
11
+ self._vision_tower = AutoModel.from_pretrained(cfg.model_name_or_path, config = cfg, trust_remote_code=True)
12
+ self._image_processor = AutoImageProcessor.from_pretrained(cfg.model_name_or_path)
13
+
14
+