Image-Text-to-Text
Transformers
Safetensors
internvl_chat
feature-extraction
conversational
custom_code
Instructions to use OS-Copilot/OS-Genesis-4B-WA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OS-Copilot/OS-Genesis-4B-WA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OS-Copilot/OS-Genesis-4B-WA", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OS-Copilot/OS-Genesis-4B-WA", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OS-Copilot/OS-Genesis-4B-WA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OS-Copilot/OS-Genesis-4B-WA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OS-Copilot/OS-Genesis-4B-WA", "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/OS-Copilot/OS-Genesis-4B-WA
- SGLang
How to use OS-Copilot/OS-Genesis-4B-WA 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 "OS-Copilot/OS-Genesis-4B-WA" \ --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": "OS-Copilot/OS-Genesis-4B-WA", "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 "OS-Copilot/OS-Genesis-4B-WA" \ --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": "OS-Copilot/OS-Genesis-4B-WA", "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 OS-Copilot/OS-Genesis-4B-WA with Docker Model Runner:
docker model run hf.co/OS-Copilot/OS-Genesis-4B-WA
Commit History
-
Add link to code repository (#1)
Verified signature- Add link to code repository (b9f0d985e4cb2b9f80c021099a2d2836c7d6d877) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>511f2ec
-
Upload modeling_phi3.py with huggingface_hub
Verified signature4efc54b -
Upload modeling_internvl_chat.py with huggingface_hub
Verified signaturec89f496 -
Upload modeling_intern_vit.py with huggingface_hub
Verified signature467ba0a -
Upload conversation.py with huggingface_hub
Verified signaturecf5cde8 -
Upload configuration_phi3.py with huggingface_hub
Verified signatured0778b0 -
Upload configuration_internvl_chat.py with huggingface_hub
Verified signaturefc9b768 -
Upload configuration_intern_vit.py with huggingface_hub
Verified signaturedad18b7
-
Upload tokenizer_config.json with huggingface_hub
Verified signature30a1e39 -
Upload tokenizer.model with huggingface_hub
Verified signaturea2abd0a -
Upload special_tokens_map.json with huggingface_hub
Verified signaturee61ead0 -
Upload model.safetensors.index.json with huggingface_hub
Verified signature2ecccf1 -
Upload model-00002-of-00002.safetensors with huggingface_hub
Verified signatureaecd025 -
Upload model-00001-of-00002.safetensors with huggingface_hub
Verified signatureea2dea5 -
Upload generation_config.json with huggingface_hub
Verified signature69934e2 -
Upload config.json with huggingface_hub
Verified signature4d1f52e -
Upload added_tokens.json with huggingface_hub
Verified signature956a93d -
Update README.md
Verified signatureb4fb273 -
initial commit
Verified signature1054afd