Image-Text-to-Text
Safetensors
MLX
Arabic
mlx-vlm
qwen3_vl
vision
ocr
arabic
arabic-ocr
conversational
4-bit precision
Instructions to use Alsamir/Abjad_0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Alsamir/Abjad_0.2 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Alsamir/Abjad_0.2") config = load_config("Alsamir/Abjad_0.2") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Alsamir/Abjad_0.2 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Alsamir/Abjad_0.2"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Alsamir/Abjad_0.2" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use Alsamir/Abjad_0.2 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Alsamir/Abjad_0.2"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Alsamir/Abjad_0.2
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Alsamir/Abjad_0.2 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Alsamir/Abjad_0.2"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Alsamir/Abjad_0.2" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download mlx_lora_entry.py from Alsamir/Abjad_0.2: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/Alsamir/Abjad_0.2/resolve/main/mlx_lora_entry.py
- Command line
-
hf download hf://Alsamir/Abjad_0.2/mlx_lora_entry.py
-
curl -L -o mlx_lora_entry.py https://huggingface.co/Alsamir/Abjad_0.2/resolve/main/mlx_lora_entry.py
1.77 kB
| #!/usr/bin/env python3 | |
| """Make mlx-vlm's trainer accept an exact local JSONL file.""" | |
| from pathlib import Path | |
| import runpy | |
| import sys | |
| import os | |
| import datasets | |
| _load_dataset = datasets.load_dataset | |
| def load_dataset(path, name=None, split=None, **kwargs): | |
| candidate = Path(path) | |
| if candidate.exists() or str(path).endswith((".json", ".jsonl")): | |
| return _load_dataset("json", data_files=str(candidate), split=split or "train") | |
| return _load_dataset(path, name, split=split, **kwargs) | |
| datasets.load_dataset = load_dataset | |
| # Qwen3-VL uses a dynamic-resolution processor. mlx-vlm's generic | |
| # image-resize-shape option is intentionally ignored by that native path, so | |
| # expose a safe pixel budget for local 16 GB Apple Silicon training. | |
| try: | |
| from mlx_vlm import utils as _mlx_utils | |
| def _bounded_process_inputs(processor, prompts, images, audio, add_special_tokens=False, return_tensors="mlx", **kwargs): | |
| max_pixels = os.environ.get("ABJAD_MAX_PIXELS") | |
| if max_pixels: | |
| # Qwen3-VL exposes these through **kwargs, so the generic helper | |
| # cannot forward them by signature inspection. | |
| kwargs["min_pixels"] = 56 * 56 | |
| kwargs["max_pixels"] = int(max_pixels) | |
| process_method = getattr(processor, "process", processor) | |
| call = { | |
| "text": prompts, | |
| "images": images, | |
| "padding": True, | |
| "return_tensors": return_tensors, | |
| "add_special_tokens": add_special_tokens, | |
| **kwargs, | |
| } | |
| return process_method(**call) | |
| _mlx_utils.process_inputs_with_fallback = _bounded_process_inputs | |
| except Exception: | |
| pass | |
| sys.argv[0] = "mlx_vlm.lora" | |
| runpy.run_module("mlx_vlm.lora", run_name="__main__") | |