Instructions to use OS-Copilot/OS-Atlas-Base-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OS-Copilot/OS-Atlas-Base-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OS-Copilot/OS-Atlas-Base-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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("OS-Copilot/OS-Atlas-Base-7B") model = AutoModelForMultimodalLM.from_pretrained("OS-Copilot/OS-Atlas-Base-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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OS-Copilot/OS-Atlas-Base-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OS-Copilot/OS-Atlas-Base-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": "OS-Copilot/OS-Atlas-Base-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/OS-Copilot/OS-Atlas-Base-7B
- SGLang
How to use OS-Copilot/OS-Atlas-Base-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 "OS-Copilot/OS-Atlas-Base-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": "OS-Copilot/OS-Atlas-Base-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 "OS-Copilot/OS-Atlas-Base-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": "OS-Copilot/OS-Atlas-Base-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 OS-Copilot/OS-Atlas-Base-7B with Docker Model Runner:
docker model run hf.co/OS-Copilot/OS-Atlas-Base-7B
Commit History
-
fix vision_config for dedicated endpoint serving
Verified signature227d2eb
-
Update README.md
Verified signature7ed87a4
-
Update README.md
Verified signaturee71ae9a -
Update README.md
Verified signature4df6e76
-
Add link to paper, metadata tags (#1)
Verified signature- Add link to paper, metadata tags (6f9ba2b6bb85f60cec04dd3ceb8845721207e467) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>ba129d7
-
Upload vocab.json with huggingface_hub
Verified signature4baf78a -
Upload tokenizer_config.json with huggingface_hub
Verified signatureac3c946 -
Upload tokenizer.json with huggingface_hub
Verified signature88feb04 -
Upload special_tokens_map.json with huggingface_hub
Verified signaturea4f88f4 -
Upload preprocessor_config.json with huggingface_hub
Verified signature39ee353 -
Upload model.safetensors.index.json with huggingface_hub
Verified signatureff7f42f -
Upload model-00004-of-00004.safetensors with huggingface_hub
Verified signature45337cf -
Upload model-00003-of-00004.safetensors with huggingface_hub
Verified signatureb8262f4 -
Upload model-00002-of-00004.safetensors with huggingface_hub
Verified signaturec8b4e9d -
Upload model-00001-of-00004.safetensors with huggingface_hub
Verified signaturee4db208 -
Upload merges.txt with huggingface_hub
Verified signature51a175f -
Upload generation_config.json with huggingface_hub
Verified signature5a91124 -
Upload config.json with huggingface_hub
Verified signaturee8510c3 -
Upload chat_template.json with huggingface_hub
Verified signature428273a -
Upload added_tokens.json with huggingface_hub
Verified signature4a78108 -
initial commit
Verified signature8002003