Image-Text-to-Text
Transformers
Safetensors
Turkish
lfm2_vl
text-generation-inference
unsloth
trl
sft
conversational
Instructions to use Ba2han/Liquid-Turkish-MiniOCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ba2han/Liquid-Turkish-MiniOCR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Ba2han/Liquid-Turkish-MiniOCR") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Ba2han/Liquid-Turkish-MiniOCR") model = AutoModelForImageTextToText.from_pretrained("Ba2han/Liquid-Turkish-MiniOCR") 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
- vLLM
How to use Ba2han/Liquid-Turkish-MiniOCR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ba2han/Liquid-Turkish-MiniOCR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ba2han/Liquid-Turkish-MiniOCR", "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/Ba2han/Liquid-Turkish-MiniOCR
- SGLang
How to use Ba2han/Liquid-Turkish-MiniOCR 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 "Ba2han/Liquid-Turkish-MiniOCR" \ --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": "Ba2han/Liquid-Turkish-MiniOCR", "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 "Ba2han/Liquid-Turkish-MiniOCR" \ --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": "Ba2han/Liquid-Turkish-MiniOCR", "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" } } ] } ] }' - Unsloth Studio new
How to use Ba2han/Liquid-Turkish-MiniOCR with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ba2han/Liquid-Turkish-MiniOCR to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ba2han/Liquid-Turkish-MiniOCR to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Ba2han/Liquid-Turkish-MiniOCR to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Ba2han/Liquid-Turkish-MiniOCR", max_seq_length=2048, ) - Docker Model Runner
How to use Ba2han/Liquid-Turkish-MiniOCR with Docker Model Runner:
docker model run hf.co/Ba2han/Liquid-Turkish-MiniOCR
# Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("Ba2han/Liquid-Turkish-MiniOCR")
model = AutoModelForImageTextToText.from_pretrained("Ba2han/Liquid-Turkish-MiniOCR")
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]:]))Quick Links
Example Script/Örnek Script
from transformers import pipeline
# ── Config ──
model_name = "Ba2han/Liquid-Turkish-MiniOCR"
image_url = "https://gezivita.com/wp-content/uploads/2017/10/Atat%C3%BCrk-diyor-ki.jpg"
# ── Pipeline ──
pipe = pipeline("image-text-to-text", model=model_name)
messages = [{"role": "user", "content": [
{"type": "image", "url": image_url},
{"type": "text", "text": "Görev: Türkçe OCR"},
]}]
result = pipe(text=messages, max_new_tokens=500, return_full_text=False,
do_sample=True, temperature=0.3, top_k=10, min_p=0.2,
repetition_penalty=1.05)
print(result[0]["generated_text"])
Result/Sonuç
CUMHURİYET
Cumhuriyet ahlâkî fazilete müstenit bir idaredir. Cumhuriyet fazilettir. Sultanlık korku ve tehdide müstenit bir idaredir. Cumhuriyet idaresi faziletti ve namuskâr insanlar yetiştirir, sultanlık korkuya, tehdide müstenit olduğu için korkak, zelil, sefil, rezil insanlar yetiştirir. (14 Ekim 1925)
Şuur daima ileriye ve yeniliğe götürür, dönüşsüz bir haslet olduğuna göre, Türkiye Cumhuriyeti halkı, ileriye ve yeniliğe uzun adımlarla yürümeye devam edecektir. (1.9.1925)
Memnuniyetle tekrar görüyorum ki, Lâik Cumhuriyet esasında beraberiz. Zaten benim siyasi hayatta bir taraflı olarak daima aradığım ve arıyacağım temel budur. (11.3.1930)
Benim naçiz vücudum elbet birgün toprak olacaktır. Fakat Türkiye Cumhuriyeti ilelebet pâyidâr kalacaktır. (Mayıs 1929)
Türk Milletinin tabiat ve şiârına en mutabık (uygun) olan idare Cumhuriyet idaresidir. (1924)
Usage/Kullanım
Görevin, sana verilen sayfadaki tüm içeriği eğitim materyali standartlarına uygun, eksiksiz ve dijital olarak okunabilir bir metne dönüştürmektir.
Görev: Türkçe OCR
Türkçe dilindeki sayfayı transkribe et. Formatı korumak adına markdown kullan.
Uploaded model
- Developed by: Ba2han
- License: apache-2.0
- Finetuned from model : LiquidAI/LFM2.5-VL-1.6B
This lfm2_vl model was trained 2x faster with Unsloth
- Downloads last month
- 9

# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Ba2han/Liquid-Turkish-MiniOCR") 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)