Instructions to use luodian/OTTER-LLaMA7B-Init with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luodian/OTTER-LLaMA7B-Init with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="luodian/OTTER-LLaMA7B-Init")# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("luodian/OTTER-LLaMA7B-Init", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use luodian/OTTER-LLaMA7B-Init with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luodian/OTTER-LLaMA7B-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-LLaMA7B-Init", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/luodian/OTTER-LLaMA7B-Init
- SGLang
How to use luodian/OTTER-LLaMA7B-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-LLaMA7B-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-LLaMA7B-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-LLaMA7B-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-LLaMA7B-Init", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use luodian/OTTER-LLaMA7B-Init with Docker Model Runner:
docker model run hf.co/luodian/OTTER-LLaMA7B-Init
Bo Li*1
Yuanhan Zhang*,1
Liangyu Chen*,1
Jinghao Wang*,1
Fanyi Pu*,1
Jingkang Yang1 Chunyuan Li2 Ziwei Liu1
Jingkang Yang1 Chunyuan Li2 Ziwei Liu1
1S-Lab, Nanyang Technological University
2Microsoft Research, Redmond
This weight is for initilizing training for Otter. It's directly converted from Openflamingo.
You can load and try this model using
model = OtterForConditionalGeneration.from_pretrained("luodian/OTTER-LLaMA7B-Init", device_map="sequential")
model.text_tokenizer.padding_side = "left"
tokenizer = model.text_tokenizer
image_processor = transformers.CLIPImageProcessor()
model.eval()
You can also start training Otter via the commands
python -m accelerate.commands.launch --config_file=./pipeline/accelerate_configs/accelerate_config_fsdp.yaml \
pipeline/train/instruction_following.py \
--pretrained_model_name_or_path=luodian/OTTER-LLaMA7B-Init \
--mimicit_path=/data/azure_storage/otter/mimicit/xx/xx_instructions.json \
--images_path=/data/azure_storage/otter/mimicit/xx/xx.json \
--batch_size=4 --num_epochs=1 --report_to_wandb \
--wandb_entity=ntu-slab \
--external_save_dir=/data/bli/checkpoints \
--save_hf_model \
--run_name=OTTER-MPT1B \
--wandb_project=OTTER-MPT1B \
--workers=4 \
--lr_scheduler=cosine \
--learning_rate=1e-5 \
--warmup_steps_ratio=0.01
If you wish to init a video instruction tuning, you should add
"max_num_frames": 128
to config.json inside the folder.
- Downloads last month
- 11