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
Update README.zh.md
Browse files- README.zh.md +1 -1
README.zh.md
CHANGED
|
@@ -13,7 +13,7 @@ language:
|
|
| 13 |
|
| 14 |
[推理说明](INFERENCE.md) · [English](README.md) · 权重 Apache-2.0 · 同时发布:[KnowLine-0.8B-Gen1](https://huggingface.co/PelaAI/KnowLine-0.8B-Gen1) · 同系列:[KnowLine-9B-Gen1](https://huggingface.co/PelaAI/KnowLine-9B-Gen1)、[KnowLine-4B-Gen5.5](https://huggingface.co/PelaAI/KnowLine-4B-Gen5.5)
|
| 15 |
|
| 16 |
-
KnowLine-2B-Gen1 是基于 Qwen3.5-2B 的 2B 决策模型:输入结构化的状态和一道或多道有类型的问题(选择题、是否题、有序打分题),输出各选项的概率。它直接读取各选项标签的概率,作答时不生成自由文本。KnowLine 由
|
| 17 |
|
| 18 |
亮点:
|
| 19 |
|
|
|
|
| 13 |
|
| 14 |
[推理说明](INFERENCE.md) · [English](README.md) · 权重 Apache-2.0 · 同时发布:[KnowLine-0.8B-Gen1](https://huggingface.co/PelaAI/KnowLine-0.8B-Gen1) · 同系列:[KnowLine-9B-Gen1](https://huggingface.co/PelaAI/KnowLine-9B-Gen1)、[KnowLine-4B-Gen5.5](https://huggingface.co/PelaAI/KnowLine-4B-Gen5.5)
|
| 15 |
|
| 16 |
+
KnowLine-2B-Gen1 是基于 Qwen3.5-2B 的 2B 决策模型:输入结构化的状态和一道或多道有类型的问题(选择题、是否题、有序打分题),输出各选项的概率。它直接读取各选项标签的概率,作答时不生成自由文本。KnowLine 由 PelaAI 开发。
|
| 17 |
|
| 18 |
亮点:
|
| 19 |
|