Instructions to use codex-automatus/htdn-arabic-350m1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codex-automatus/htdn-arabic-350m1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codex-automatus/htdn-arabic-350m1")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("codex-automatus/htdn-arabic-350m1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codex-automatus/htdn-arabic-350m1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codex-automatus/htdn-arabic-350m1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codex-automatus/htdn-arabic-350m1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codex-automatus/htdn-arabic-350m1
- SGLang
How to use codex-automatus/htdn-arabic-350m1 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 "codex-automatus/htdn-arabic-350m1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codex-automatus/htdn-arabic-350m1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "codex-automatus/htdn-arabic-350m1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codex-automatus/htdn-arabic-350m1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codex-automatus/htdn-arabic-350m1 with Docker Model Runner:
docker model run hf.co/codex-automatus/htdn-arabic-350m1
HTDN — نموذج لغوي مخصّص (JAX/Flax)
نموذج HTDN (بنية مخصّصة تجمع بين طبقة ديناميكيات متكرّرة وانتباه ذاتي سببي مع RoPE و SwiGLU) دُرِّب على بيانات عربية متعددة المصادر (streaming)
⚠️ هذه ليست معمارية transformers قياسية، لذا لا يمكن تحميلها مباشرة
عبر AutoModel.from_pretrained. الأوزان محفوظة بصيغة safetensors ومرفق
كود بناء النموذج (modeling_htdn.py) لإعادة تحميلها عبر JAX/Flax.
طريقة التحميل
from huggingface_hub import hf_hub_download
import json, jax.numpy as jnp
from safetensors import safe_open
from flax.traverse_util import unflatten_dict
# 1) نزّل الملفات
config_path = hf_hub_download("gijl/htdn-arabic-350m1", "config.json")
weights_path = hf_hub_download("gijl/htdn-arabic-350m1", "model.safetensors")
modeling_path = hf_hub_download("gijl/htdn-arabic-350m1", "modeling_htdn.py")
with open(config_path) as f:
cfg = json.load(f)
# 2) حمّل الأوزان
flat = {}
with safe_open(weights_path, framework="numpy") as f:
for k in f.keys():
flat[k] = jnp.array(f.get_tensor(k))
params = unflatten_dict(flat, sep=".")
# 3) أعد بناء النموذج (انظر modeling_htdn.py المرفق)
import importlib.util
spec = importlib.util.spec_from_file_location("modeling_htdn", modeling_path)
modeling_htdn = importlib.util.module_from_spec(spec)
spec.loader.exec_module(modeling_htdn)
model, _ = modeling_htdn.build_model_template(cfg)
# استخدم `params` أعلاه بدل المعاملات العشوائية من build_model_template
معلومات التدريب
- عدد المعاملات: ~350M
- المحلل اللغوي:
bert-base-multilingual-cased
هذا نموذج تجريبي/بحثي — النتائج أولية.
- Downloads last month
- 185