Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
qwen3.5
decision-model
structured-prediction
text-classification
conversational
Instructions to use PelaAI/KnowLine-2B-Gen1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PelaAI/KnowLine-2B-Gen1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="PelaAI/KnowLine-2B-Gen1") 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("PelaAI/KnowLine-2B-Gen1") model = AutoModelForMultimodalLM.from_pretrained("PelaAI/KnowLine-2B-Gen1", 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 PelaAI/KnowLine-2B-Gen1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PelaAI/KnowLine-2B-Gen1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PelaAI/KnowLine-2B-Gen1", "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/PelaAI/KnowLine-2B-Gen1
- SGLang
How to use PelaAI/KnowLine-2B-Gen1 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 "PelaAI/KnowLine-2B-Gen1" \ --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": "PelaAI/KnowLine-2B-Gen1", "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 "PelaAI/KnowLine-2B-Gen1" \ --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": "PelaAI/KnowLine-2B-Gen1", "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 PelaAI/KnowLine-2B-Gen1 with Docker Model Runner:
docker model run hf.co/PelaAI/KnowLine-2B-Gen1
Download SHA256SUMS from PelaAI/KnowLine-2B-Gen1: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/PelaAI/KnowLine-2B-Gen1/resolve/main/SHA256SUMS
- Command line
-
hf download hf://PelaAI/KnowLine-2B-Gen1/SHA256SUMS
-
curl -L -o SHA256SUMS https://huggingface.co/PelaAI/KnowLine-2B-Gen1/resolve/main/SHA256SUMS
1.77 kB
| 7db76a2ad42c79b2579f4c87dcd0c0b1fae8768be2ae3013a69131cf0ce64504 CALIBRATION.json | |
| 176558103d49838fb06f6575a9f9f90d8b6bd124636829a7e052cfdbe2986bd6 INFERENCE.md | |
| 50cbab8a892c5f2993b8c7351a99182507472def3b1374558308605d99b86b32 LICENSE | |
| 1e0d96c307bfa11be23b8ffb756e91670911b24f107f71f44cca627ff8ef1374 README.md | |
| 24110d2d7703944c5b46467a31a4d0bb534a3b59b0b5f44b30a1ca29513c352b README.zh.md | |
| 273d8e0e683b885071fb17e08d71e5f2a5ddfb5309756181681de4f5a1822d80 chat_template.jinja | |
| ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4 config.json | |
| 3a2a1244fced07d20e83120f8b1bc4a4605eeb8132d6accd01b1352d4c8443e6 knowline_engine.py | |
| 2e839fa24f1ad9c980898b2a9aa62e2154ba3f57618bd5f2fedb5756f61f062f knowline_layout.py | |
| b9a32b51c6477196c0664920b9ddac77de76d82ffeddc18e61d45583df12981f knowline_server.py | |
| a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt | |
| bac1595ec2e851f5d1eff3fbeb66828b1ca6e11553c090f9d2bf029858a53cff model-extra-from-base.safetensors | |
| 5a738877918f67772b70ea961d56c553964bd770204b98ab412e123df1b0d1fc model.safetensors | |
| 3f54680a3f0cb5a9c80dfc399c0d4171438da186b1d4905cf3bf97d89eff6fc7 model.safetensors.index.json | |
| 27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json | |
| 5888c14f802fd885a19db40ba7833a0a9dc08222e008e7c24730c9ea4a9c7bef serve_knowline.sh | |
| a2a97e936bfc067ebf874bd039d3ec01df96d29b6cb28df23621b42d6c5c504e temperatures.json | |
| 5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42 tokenizer.json | |
| 49e2b6e395f959f077f1e992b338919c0d4a9732fc6e613995e06557f843500c tokenizer_config.json | |
| 7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.json | |
| ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json | |