|
--- |
|
license: cc |
|
language: |
|
- en |
|
base_model: |
|
- Qwen/Qwen2.5-1.5B-Instruct |
|
--- |
|
|
|
Dependency setups: |
|
|
|
```bash |
|
pip install transformers==4.46 accelerate opencv-python torchvision einops |
|
pip install git+https://github.com/bfshi/scaling_on_scales.git |
|
``` |
|
|
|
|
|
```python |
|
from transformers import AutoConfig, AutoModel |
|
from termcolor import colored |
|
|
|
model_path = "Efficient-Large-Model/NVILA-Lite-2B-hf-preview" |
|
|
|
# config = AutoConfig.from_pretrained(model_path, trust_remote_code=True) |
|
# model = AutoModel.from_config(config, trust_remote_code=True) |
|
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, device_map="auto") |
|
res = model.generate_content([ |
|
"how are you today?" |
|
]) |
|
print(colored(res, "cyan", attrs=["bold"])) |
|
|
|
print("---" * 40) |
|
|
|
import PIL.Image |
|
response = model.generate_content([ |
|
PIL.Image.open("inference_test/test_data/caption_meat.jpeg"), |
|
"describe the image?" |
|
]) |
|
print(colored(response, "cyan", attrs=["bold"])) |
|
``` |