Image-Text-to-Text
Transformers
Safetensors
English
Turkish
qwen3_5
loopl
on-device
agent
tool-calling
qwen3.5
sft
vision
conversational
Instructions to use cagataydev/loopl-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cagataydev/loopl-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cagataydev/loopl-4b") 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("cagataydev/loopl-4b") model = AutoModelForMultimodalLM.from_pretrained("cagataydev/loopl-4b", 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 cagataydev/loopl-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cagataydev/loopl-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cagataydev/loopl-4b", "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/cagataydev/loopl-4b
- SGLang
How to use cagataydev/loopl-4b 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 "cagataydev/loopl-4b" \ --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": "cagataydev/loopl-4b", "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 "cagataydev/loopl-4b" \ --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": "cagataydev/loopl-4b", "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 cagataydev/loopl-4b with Docker Model Runner:
docker model run hf.co/cagataydev/loopl-4b
tokenizer: normalise for the loopl app (swift-transformers) — tokenizer.json → base serialization (differs in ['decoder', 'pre_tokenizer', 'truncation']; vocab/merges/added_tokens identical); tokenizer_config.json: tokenizer_class 'Qwen3_5Tokenizer' → 'Qwen2Tokenizer', drop `backend`; vocab.json added from mlx-community/Qwen3.5-4B-4bit
Browse files- tokenizer.json +2 -2
- tokenizer_config.json +1 -2
- vocab.json +0 -0
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
|
| 3 |
+
size 19989343
|
tokenizer_config.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
"audio_bos_token": "<|audio_start|>",
|
| 4 |
"audio_eos_token": "<|audio_end|>",
|
| 5 |
"audio_token": "<|audio_pad|>",
|
| 6 |
-
"backend": "tokenizers",
|
| 7 |
"bos_token": null,
|
| 8 |
"clean_up_tokenization_spaces": false,
|
| 9 |
"eos_token": "<|im_end|>",
|
|
@@ -40,7 +39,7 @@
|
|
| 40 |
"pad_token": "<|endoftext|>",
|
| 41 |
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 42 |
"split_special_tokens": false,
|
| 43 |
-
"tokenizer_class": "
|
| 44 |
"unk_token": null,
|
| 45 |
"video_token": "<|video_pad|>",
|
| 46 |
"vision_bos_token": "<|vision_start|>",
|
|
|
|
| 3 |
"audio_bos_token": "<|audio_start|>",
|
| 4 |
"audio_eos_token": "<|audio_end|>",
|
| 5 |
"audio_token": "<|audio_pad|>",
|
|
|
|
| 6 |
"bos_token": null,
|
| 7 |
"clean_up_tokenization_spaces": false,
|
| 8 |
"eos_token": "<|im_end|>",
|
|
|
|
| 39 |
"pad_token": "<|endoftext|>",
|
| 40 |
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 41 |
"split_special_tokens": false,
|
| 42 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 43 |
"unk_token": null,
|
| 44 |
"video_token": "<|video_pad|>",
|
| 45 |
"vision_bos_token": "<|vision_start|>",
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|