Image-Text-to-Text
Transformers
English
vision-language-model
vlm
surveillance
iot
gemma
vl-jepa
multimodal
object-detection
video-analytics
Instructions to use hardiksa/arcisvlm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hardiksa/arcisvlm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="hardiksa/arcisvlm")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hardiksa/arcisvlm", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hardiksa/arcisvlm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hardiksa/arcisvlm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hardiksa/arcisvlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hardiksa/arcisvlm
- SGLang
How to use hardiksa/arcisvlm 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 "hardiksa/arcisvlm" \ --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": "hardiksa/arcisvlm", "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 "hardiksa/arcisvlm" \ --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": "hardiksa/arcisvlm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hardiksa/arcisvlm with Docker Model Runner:
docker model run hf.co/hardiksa/arcisvlm
| """Train BPE tokenizer on caption/VQA text data.""" | |
| import os | |
| import json | |
| from model.tokenizer import BPETokenizer | |
| def collect_texts(flickr_dir: str = "data/flickr8k", vqa_dir: str = "data/vqav2") -> list[str]: | |
| """Collect all text from captions and VQA data.""" | |
| texts = [] | |
| # Flickr8k captions | |
| captions_file = os.path.join(flickr_dir, "captions.txt") | |
| if os.path.exists(captions_file): | |
| with open(captions_file) as f: | |
| for line in f: | |
| parts = line.strip().split("\t", 1) | |
| if len(parts) == 2: | |
| texts.append(parts[1]) | |
| # VQA questions + answers | |
| q_file = os.path.join(vqa_dir, "questions.json") | |
| a_file = os.path.join(vqa_dir, "annotations.json") | |
| if os.path.exists(q_file): | |
| with open(q_file) as f: | |
| for q in json.load(f)["questions"]: | |
| texts.append(q["question"]) | |
| if os.path.exists(a_file): | |
| with open(a_file) as f: | |
| for a in json.load(f)["annotations"]: | |
| texts.append(a["multiple_choice_answer"]) | |
| return texts | |
| def main(): | |
| texts = collect_texts() | |
| print(f"Collected {len(texts)} text samples") | |
| tokenizer = BPETokenizer(vocab_size=8192) | |
| print("Training BPE tokenizer...") | |
| tokenizer.train(texts) | |
| print(f"Vocabulary size: {len(tokenizer)}") | |
| # Save | |
| os.makedirs("checkpoints", exist_ok=True) | |
| tokenizer.save("checkpoints/tokenizer.json") | |
| print("Saved tokenizer to checkpoints/tokenizer.json") | |
| # Test | |
| test_texts = [ | |
| "What color is the sky?", | |
| "a dog playing in the park", | |
| "How many people are there?", | |
| ] | |
| for text in test_texts: | |
| ids = tokenizer.encode(text) | |
| decoded = tokenizer.decode(ids) | |
| print(f" '{text}' -> {ids[:10]}... -> '{decoded}'") | |
| if __name__ == "__main__": | |
| main() | |