Image-Text-to-Text
Transformers
Safetensors
llava
text-generation
navigation
embodied-ai
vln
qwen2
snav
navspace
conversational
Instructions to use TidalYang/SNav-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TidalYang/SNav-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="TidalYang/SNav-7B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("TidalYang/SNav-7B") model = AutoModelForCausalLM.from_pretrained("TidalYang/SNav-7B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TidalYang/SNav-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TidalYang/SNav-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TidalYang/SNav-7B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/TidalYang/SNav-7B
- SGLang
How to use TidalYang/SNav-7B 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 "TidalYang/SNav-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TidalYang/SNav-7B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "TidalYang/SNav-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TidalYang/SNav-7B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use TidalYang/SNav-7B with Docker Model Runner:
docker model run hf.co/TidalYang/SNav-7B
File size: 844 Bytes
04d236f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 44fa11e5f000ecb802195221d4983798 added_tokens.json b386763d8490a3c6ee3392bf3753c5d0 config.json 7be9de077cc14f9200877b8a57e05255 generation_config.json 72dacf1de43bc354dc3c521e44ed0b24 merges.txt 7b4f857410988fc99b2afac0c7a5671a model-00001-of-00004.safetensors 3f79fc0c98052be8bca8ffbf9bd87a95 model-00002-of-00004.safetensors 6e94815fdd3fa5ab478de4f6d6e4649c model-00003-of-00004.safetensors b16ade47a681a6962c85b6e5ec58a89a model-00004-of-00004.safetensors 5c1838434c31ac73ade9799bb9c9c92d model.safetensors.index.json 0096302a347c0f21b27ea2ec0c450338 special_tokens_map.json 5291665f95fbd50356a4a1c2c45b9960 tokenizer.json 5d5387ff89bfc47d7a5a60f02d7a419f tokenizer_config.json fcb9c45318833c8090bdcb25fd975e6c trainer_state.json 8c321ca3115f49872d55eec99fd4e5c8 training_args.bin 613b8e4a622c4a2c90e9e1245fc540d6 vocab.json |