Image-Text-to-Text
Transformers
Safetensors
English
spatialvla
feature-extraction
VLA
Foundation Vision-language-action Model
Generalist Robot Policy
robotics
custom_code
Instructions to use IPEC-COMMUNITY/spatialvla-4b-224-pt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IPEC-COMMUNITY/spatialvla-4b-224-pt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="IPEC-COMMUNITY/spatialvla-4b-224-pt", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("IPEC-COMMUNITY/spatialvla-4b-224-pt", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IPEC-COMMUNITY/spatialvla-4b-224-pt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IPEC-COMMUNITY/spatialvla-4b-224-pt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IPEC-COMMUNITY/spatialvla-4b-224-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IPEC-COMMUNITY/spatialvla-4b-224-pt
- SGLang
How to use IPEC-COMMUNITY/spatialvla-4b-224-pt 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 "IPEC-COMMUNITY/spatialvla-4b-224-pt" \ --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": "IPEC-COMMUNITY/spatialvla-4b-224-pt", "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 "IPEC-COMMUNITY/spatialvla-4b-224-pt" \ --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": "IPEC-COMMUNITY/spatialvla-4b-224-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IPEC-COMMUNITY/spatialvla-4b-224-pt with Docker Model Runner:
docker model run hf.co/IPEC-COMMUNITY/spatialvla-4b-224-pt
Upload folder using huggingface_hub
Browse files- test_huggingface.py +1 -1
test_huggingface.py
CHANGED
|
@@ -19,7 +19,7 @@ if __name__ == "__main__":
|
|
| 19 |
|
| 20 |
image = Image.open("example.png").convert("RGB")
|
| 21 |
images = [image] * args.num_images
|
| 22 |
-
prompt = "What action should the robot take to pick the
|
| 23 |
inputs = processor(images=images, text=prompt, unnorm_key="bridge_orig/1.0.0", return_tensors="pt")
|
| 24 |
print(inputs)
|
| 25 |
|
|
|
|
| 19 |
|
| 20 |
image = Image.open("example.png").convert("RGB")
|
| 21 |
images = [image] * args.num_images
|
| 22 |
+
prompt = "What action should the robot take to pick the cup?"
|
| 23 |
inputs = processor(images=images, text=prompt, unnorm_key="bridge_orig/1.0.0", return_tensors="pt")
|
| 24 |
print(inputs)
|
| 25 |
|