Image-Text-to-Text
Transformers
Safetensors
qwen3_vl
multimodal
scientific
protein
rna
dna
molecule
weather
medical-imaging
conversational
Instructions to use sais-org/MKB with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sais-org/MKB with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="sais-org/MKB") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("sais-org/MKB") model = AutoModelForMultimodalLM.from_pretrained("sais-org/MKB", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sais-org/MKB with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sais-org/MKB" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sais-org/MKB", "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/sais-org/MKB
- SGLang
How to use sais-org/MKB 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 "sais-org/MKB" \ --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": "sais-org/MKB", "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 "sais-org/MKB" \ --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": "sais-org/MKB", "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 sais-org/MKB with Docker Model Runner:
docker model run hf.co/sais-org/MKB
Update pipeline tag to any-to-any and add paper link
#3
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
license: other
|
| 3 |
license_name: apache-2.0-and-sam-license
|
| 4 |
license_link: LICENSE
|
| 5 |
-
|
| 6 |
-
pipeline_tag: image-text-to-text
|
| 7 |
tags:
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
SAM_LICENSE.txt). By accessing these weights you agree to that license,
|
| 23 |
-
including its acceptable-use restrictions.
|
| 24 |
---
|
| 25 |
|
| 26 |
<div align="center">
|
| 27 |
|
| 28 |
-
[π€ Model](https://huggingface.co/sais-org/MKB) β’ [π» GitHub](https://github.com/Shanghai-Academy-of-AI-For-Science/MKB) β’ [π Technical Report](https://github.com/Shanghai-Academy-of-AI-For-Science/MKB/blob/main/docs/MKB.pdf) β’ [βοΈ License: Apache-2.0 + SAM License](https://github.com/Shanghai-Academy-of-AI-For-Science/MKB/blob/main/LICENSE)
|
| 29 |
|
| 30 |
</div>
|
| 31 |
|
|
@@ -147,7 +147,8 @@ export PYTHONPATH=$PWD/code
|
|
| 147 |
python code/inference.py --model_path model --greedy --max_new_tokens 64 \
|
| 148 |
--rna "GGATGCGATCATGTCTGCACTAACACACCGGATCCCATCAGAACTCCGAAGTTAAGCGTGCTTGGGCGGGAGTAGTACTAGGATGGGCGACCCCTTAGGAAGTACTCGTGTTGCATCCC" \
|
| 149 |
--system "You are a non-coding RNA family classifier. Output only the family name, no other text." \
|
| 150 |
-
--prompt $'<rna>
|
|
|
|
| 151 |
```
|
| 152 |
|
| 153 |
All weights are contained in `model.safetensors`: the scientific
|
|
@@ -179,4 +180,4 @@ See `THIRD_PARTY_LICENSES.md` / `NOTICE` for the full third-party breakdown.
|
|
| 179 |
year = {2026},
|
| 180 |
note = {https://huggingface.co/sais-org/MKB}
|
| 181 |
}
|
| 182 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model:
|
| 3 |
+
- Qwen/Qwen3-VL-8B-Instruct
|
| 4 |
+
library_name: transformers
|
| 5 |
license: other
|
| 6 |
license_name: apache-2.0-and-sam-license
|
| 7 |
license_link: LICENSE
|
| 8 |
+
pipeline_tag: any-to-any
|
|
|
|
| 9 |
tags:
|
| 10 |
+
- multimodal
|
| 11 |
+
- scientific
|
| 12 |
+
- protein
|
| 13 |
+
- rna
|
| 14 |
+
- dna
|
| 15 |
+
- molecule
|
| 16 |
+
- weather
|
| 17 |
+
- medical-imaging
|
| 18 |
+
extra_gated_heading: You need to agree to Meta's SAM License to use the medical-image
|
| 19 |
+
segmentation weights
|
| 20 |
+
extra_gated_description: The bulk of this model is Apache-2.0. The medical-image segmentation
|
| 21 |
+
branch embeds SAM 3 weights, which are governed by Meta's SAM License (see SAM_LICENSE.txt).
|
| 22 |
+
By accessing these weights you agree to that license, including its acceptable-use
|
| 23 |
+
restrictions.
|
|
|
|
|
|
|
| 24 |
---
|
| 25 |
|
| 26 |
<div align="center">
|
| 27 |
|
| 28 |
+
[π€ Model](https://huggingface.co/sais-org/MKB) β’ [π» GitHub](https://github.com/Shanghai-Academy-of-AI-For-Science/MKB) β’ [π Technical Report](https://github.com/Shanghai-Academy-of-AI-For-Science/MKB/blob/main/docs/MKB.pdf) β’ [π Paper](https://huggingface.co/papers/2607.20557) β’ [βοΈ License: Apache-2.0 + SAM License](https://github.com/Shanghai-Academy-of-AI-For-Science/MKB/blob/main/LICENSE)
|
| 29 |
|
| 30 |
</div>
|
| 31 |
|
|
|
|
| 147 |
python code/inference.py --model_path model --greedy --max_new_tokens 64 \
|
| 148 |
--rna "GGATGCGATCATGTCTGCACTAACACACCGGATCCCATCAGAACTCCGAAGTTAAGCGTGCTTGGGCGGGAGTAGTACTAGGATGGGCGACCCCTTAGGAAGTACTCGTGTTGCATCCC" \
|
| 149 |
--system "You are a non-coding RNA family classifier. Output only the family name, no other text." \
|
| 150 |
+
--prompt $'<rna>
|
| 151 |
+
Which family does this non-coding RNA sequence belong to?'
|
| 152 |
```
|
| 153 |
|
| 154 |
All weights are contained in `model.safetensors`: the scientific
|
|
|
|
| 180 |
year = {2026},
|
| 181 |
note = {https://huggingface.co/sais-org/MKB}
|
| 182 |
}
|
| 183 |
+
```
|