Image-Text-to-Text
Transformers
Safetensors
qwen3_5
document-parsing
ocr
layout-analysis
table-recognition
vision-language
african-languages
handwriting
conversational
Instructions to use AminiTech/Soma-1X-lite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AminiTech/Soma-1X-lite with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AminiTech/Soma-1X-lite") 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("AminiTech/Soma-1X-lite") model = AutoModelForMultimodalLM.from_pretrained("AminiTech/Soma-1X-lite", 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 AminiTech/Soma-1X-lite with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AminiTech/Soma-1X-lite" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AminiTech/Soma-1X-lite", "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/AminiTech/Soma-1X-lite
- SGLang
How to use AminiTech/Soma-1X-lite 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 "AminiTech/Soma-1X-lite" \ --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": "AminiTech/Soma-1X-lite", "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 "AminiTech/Soma-1X-lite" \ --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": "AminiTech/Soma-1X-lite", "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 AminiTech/Soma-1X-lite with Docker Model Runner:
docker model run hf.co/AminiTech/Soma-1X-lite
Model card: base_model Qwen/Qwen3.5-2B; drop multi-pass subsection and Resources line; link example sources
Browse files
README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
library_name: transformers
|
|
|
|
|
|
|
| 4 |
pipeline_tag: image-text-to-text
|
| 5 |
language: [en, fr, es, sw, yo, ha, wo, ln, xh, af, rw, ny, sg]
|
| 6 |
tags: [document-parsing, ocr, layout-analysis, table-recognition, vision-language, african-languages, handwriting]
|
|
@@ -16,8 +18,6 @@ Soma-1X Lite is a 2-billion-parameter vision-language model developed by [Amini]
|
|
| 16 |
|
| 17 |
The model combines competitive document parsing performance, multilingual transcription and efficient inference, with the flexibility to run on private infrastructure.
|
| 18 |
|
| 19 |
-
**Resources:** Launch Blog | Inference Code | Evaluation Code
|
| 20 |
-
|
| 21 |
## Highlights
|
| 22 |
|
| 23 |
- **Structured document understanding:** Joint extraction of content, semantic elements, bounding boxes and reading order, with tables in HTML and mathematical expressions in LaTeX.
|
|
@@ -223,12 +223,6 @@ response = client.chat.completions.create(
|
|
| 223 |
print(response.choices[0].message.content)
|
| 224 |
```
|
| 225 |
|
| 226 |
-
### Multi-pass Inference
|
| 227 |
-
|
| 228 |
-
Soma-1X Lite supports an optional multi-pass inference harness that selectively reprocesses challenging document regions, including complex tables and rotated pages.
|
| 229 |
-
|
| 230 |
-
*[Multi-pass inference script and usage instructions]*
|
| 231 |
-
|
| 232 |
## Benchmark Performance
|
| 233 |
|
| 234 |
### olmOCR-Bench
|
|
@@ -279,13 +273,13 @@ Typed text, handwritten annotations, stamps and signatures, in reading order and
|
|
| 279 |
|
| 280 |

|
| 281 |
|
| 282 |
-
*Source: British Library, Endangered Archives Programme, EAP541.*
|
| 283 |
|
| 284 |
### Handwritten correspondence, 1927
|
| 285 |
|
| 286 |

|
| 287 |
|
| 288 |
-
*Source: British Library, Endangered Archives Programme, EAP541.*
|
| 289 |
|
| 290 |
### Handwritten administrative record (French), 1933
|
| 291 |
|
|
@@ -299,7 +293,7 @@ Typed text, handwritten annotations, stamps and signatures, in reading order and
|
|
| 299 |
|
| 300 |

|
| 301 |
|
| 302 |
-
*Source: Genootskap van Regte Afrikaners, public domain, via Wikimedia Commons.*
|
| 303 |
|
| 304 |
### Official document (Kinyarwanda), 1977
|
| 305 |
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
library_name: transformers
|
| 4 |
+
base_model: Qwen/Qwen3.5-2B
|
| 5 |
+
base_model_relation: finetune
|
| 6 |
pipeline_tag: image-text-to-text
|
| 7 |
language: [en, fr, es, sw, yo, ha, wo, ln, xh, af, rw, ny, sg]
|
| 8 |
tags: [document-parsing, ocr, layout-analysis, table-recognition, vision-language, african-languages, handwriting]
|
|
|
|
| 18 |
|
| 19 |
The model combines competitive document parsing performance, multilingual transcription and efficient inference, with the flexibility to run on private infrastructure.
|
| 20 |
|
|
|
|
|
|
|
| 21 |
## Highlights
|
| 22 |
|
| 23 |
- **Structured document understanding:** Joint extraction of content, semantic elements, bounding boxes and reading order, with tables in HTML and mathematical expressions in LaTeX.
|
|
|
|
| 223 |
print(response.choices[0].message.content)
|
| 224 |
```
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
## Benchmark Performance
|
| 227 |
|
| 228 |
### olmOCR-Bench
|
|
|
|
| 273 |
|
| 274 |

|
| 275 |
|
| 276 |
+
*Source: British Library, Endangered Archives Programme, [EAP541](https://eap.bl.uk/project/EAP541).*
|
| 277 |
|
| 278 |
### Handwritten correspondence, 1927
|
| 279 |
|
| 280 |

|
| 281 |
|
| 282 |
+
*Source: British Library, Endangered Archives Programme, [EAP541](https://eap.bl.uk/project/EAP541).*
|
| 283 |
|
| 284 |
### Handwritten administrative record (French), 1933
|
| 285 |
|
|
|
|
| 293 |
|
| 294 |

|
| 295 |
|
| 296 |
+
*Source: Genootskap van Regte Afrikaners, public domain, via [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Afrikaanse_Patriot.jpg).*
|
| 297 |
|
| 298 |
### Official document (Kinyarwanda), 1977
|
| 299 |
|