Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
qwen3.5
decision-model
structured-prediction
text-classification
conversational
Instructions to use PelaAI/KnowLine-9B-Gen2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PelaAI/KnowLine-9B-Gen2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="PelaAI/KnowLine-9B-Gen2") 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-9B-Gen2") model = AutoModelForMultimodalLM.from_pretrained("PelaAI/KnowLine-9B-Gen2", 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-9B-Gen2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PelaAI/KnowLine-9B-Gen2" # 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-9B-Gen2", "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-9B-Gen2
- SGLang
How to use PelaAI/KnowLine-9B-Gen2 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-9B-Gen2" \ --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-9B-Gen2", "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-9B-Gen2" \ --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-9B-Gen2", "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-9B-Gen2 with Docker Model Runner:
docker model run hf.co/PelaAI/KnowLine-9B-Gen2
Download SHA256SUMS from PelaAI/KnowLine-9B-Gen2: direct link, hf CLI and curl.
- Browser
- Download file 2.17 kB
-
https://huggingface.co/PelaAI/KnowLine-9B-Gen2/resolve/main/SHA256SUMS
- Command line
-
hf download hf://PelaAI/KnowLine-9B-Gen2/SHA256SUMS
-
curl -L -o SHA256SUMS https://huggingface.co/PelaAI/KnowLine-9B-Gen2/resolve/main/SHA256SUMS
2.17 kB
| fb4513f9a5f98b2910fb1a31480498bdf869235dd3aac6eefe6ab483187f8396 CALIBRATION.json | |
| 080b92170355ada8fd252353d5217cd794474c082b7b523e2bb3e8e377997895 INFERENCE.md | |
| 50cbab8a892c5f2993b8c7351a99182507472def3b1374558308605d99b86b32 LICENSE | |
| afb80729833bd003c6b977f79e49b58775fee8d10d62f84c09be9080c3923de1 README.md | |
| c8758e777de27b9a24f71d67902b719418ae2878606788f59ee4bc471d61211a README.zh.md | |
| a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715 chat_template.jinja | |
| d0883072e01861ed0b2d47be3c16c36a8e81c224c7ffaa310c6558fb3f932b05 config.json | |
| 2d4464e2ead06bc9bc718c781309ad1e7baded626d66e8dcdc8b469ba185faf0 configuration.json | |
| 4f05e06b6021e6b0b5f00d4c6bc2f98a3a824c9a254ec901ba42c9070ac50ac9 knowline_engine.py | |
| 2e839fa24f1ad9c980898b2a9aa62e2154ba3f57618bd5f2fedb5756f61f062f knowline_layout.py | |
| fd3b0c3de6bd19b6ffbf330f8fe0e8968d6e9d0f41a1f65d9d6927e52a43082e knowline_server.py | |
| a9d356d7bdf1ef4949e3e748e95b8e10ad9d4e2e838eddc38a0a7b6b94d1db8d merges.txt | |
| 90d112abadb7ad12cd4cdcc2273446fd2be77a38c8b09e26f8e13fa2f21f0ac9 model-00001-of-00004.safetensors | |
| 179d971157454d254fb3e78849abbe3768c3030e7623cb9b1878ac16fbf810b2 model-00002-of-00004.safetensors | |
| 3a627dcbb7e9319ea99da1ea33c7de47aeda575e15606cc354ef2d388846028d model-00003-of-00004.safetensors | |
| 16d742434576a30b15e39c3925e0473f9fa8190d317e9c643b91132b6abdaf0e model-00004-of-00004.safetensors | |
| c41ed69b9d21f0772737d4fb74bf48283a473ec34fb5df07afb487f35d67c28f model-extra-from-base.safetensors | |
| efee6aea7d27319549e35f3bf76600eeb1313fa6bedf353d810e053bbdff8a81 model.safetensors.index.json | |
| 27225450ac9c6529872ee1924fcb0962ff5634834f817040f444118116f4e516 preprocessor_config.json | |
| 4067150eae3c29a60c94e9a066004f74921b32717186f996c7064212478305a7 serve_knowline.sh | |
| 020619e29ec28191ed467e85c1dcbc28b53d6ccfaa98ccc4bf684682b9aeb1e4 temperatures.json | |
| 5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42 tokenizer.json | |
| 316230d6a809701f4db5ea8f8fc862bc3a6f3229c937c174e674ff3ca0a64ac8 tokenizer_config.json | |
| 7768af27c1fafa9cc9011c1dc20067e03f8915e03b63504550e11d5066986d13 video_preprocessor_config.json | |
| ce99b4cb2983d118806ce0a8b777a35b093e2000a503ebde25853284c9dfa003 vocab.json | |