Instructions to use luodian/OTTER-MPT7B-Init with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luodian/OTTER-MPT7B-Init with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="luodian/OTTER-MPT7B-Init")# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("luodian/OTTER-MPT7B-Init", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use luodian/OTTER-MPT7B-Init with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luodian/OTTER-MPT7B-Init" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luodian/OTTER-MPT7B-Init", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/luodian/OTTER-MPT7B-Init
- SGLang
How to use luodian/OTTER-MPT7B-Init with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "luodian/OTTER-MPT7B-Init" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luodian/OTTER-MPT7B-Init", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "luodian/OTTER-MPT7B-Init" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luodian/OTTER-MPT7B-Init", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use luodian/OTTER-MPT7B-Init with Docker Model Runner:
docker model run hf.co/luodian/OTTER-MPT7B-Init
Update README.md
Browse files
README.md
CHANGED
|
@@ -25,7 +25,7 @@ license: mit
|
|
| 25 |
<sup>2</sup>Microsoft Research, Redmond
|
| 26 |
</div>
|
| 27 |
|
| 28 |
-
This weight is for **initilizing training for Otter
|
| 29 |
|
| 30 |
You can load and try this model using
|
| 31 |
```python
|
|
@@ -36,4 +36,27 @@ image_processor = transformers.CLIPImageProcessor()
|
|
| 36 |
model.eval()
|
| 37 |
```
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
<sup>2</sup>Microsoft Research, Redmond
|
| 26 |
</div>
|
| 27 |
|
| 28 |
+
This weight is for **initilizing training for Otter**. It's directly converted from Openflamingo.
|
| 29 |
|
| 30 |
You can load and try this model using
|
| 31 |
```python
|
|
|
|
| 36 |
model.eval()
|
| 37 |
```
|
| 38 |
|
| 39 |
+
You can also start training Otter via the commands
|
| 40 |
+
```python
|
| 41 |
+
python -m accelerate.commands.launch --config_file=./pipeline/accelerate_configs/accelerate_config_fsdp.yaml \
|
| 42 |
+
pipeline/train/instruction_following.py \
|
| 43 |
+
--pretrained_model_name_or_path=luodian/OTTER-MPT7B-Init \
|
| 44 |
+
--mimicit_path=/data/azure_storage/otter/mimicit/xx/xx_instructions.json \
|
| 45 |
+
--images_path=/data/azure_storage/otter/mimicit/xx/xx.json \
|
| 46 |
+
--batch_size=4 --num_epochs=1 --report_to_wandb \
|
| 47 |
+
--wandb_entity=ntu-slab \
|
| 48 |
+
--external_save_dir=/data/bli/checkpoints \
|
| 49 |
+
--save_hf_model \
|
| 50 |
+
--run_name=OTTER-MPT1B \
|
| 51 |
+
--wandb_project=OTTER-MPT1B \
|
| 52 |
+
--workers=4 \
|
| 53 |
+
--lr_scheduler=cosine \
|
| 54 |
+
--learning_rate=1e-5 \
|
| 55 |
+
--warmup_steps_ratio=0.01
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
If you wish to init a video instruction tuning, you should add
|
| 59 |
+
```json
|
| 60 |
+
"max_num_frames": 128
|
| 61 |
+
```
|
| 62 |
+
to `config.json` inside the folder.
|