Instructions to use Salahin/youtube-audiobook-title-parser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salahin/youtube-audiobook-title-parser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Salahin/youtube-audiobook-title-parser") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Salahin/youtube-audiobook-title-parser") model = AutoModelForCausalLM.from_pretrained("Salahin/youtube-audiobook-title-parser", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Salahin/youtube-audiobook-title-parser with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Salahin/youtube-audiobook-title-parser:Q4_K_M # Run inference directly in the terminal: llama cli -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Salahin/youtube-audiobook-title-parser:Q4_K_M # Run inference directly in the terminal: llama cli -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Salahin/youtube-audiobook-title-parser:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Salahin/youtube-audiobook-title-parser:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
Use Docker
docker model run hf.co/Salahin/youtube-audiobook-title-parser:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Salahin/youtube-audiobook-title-parser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Salahin/youtube-audiobook-title-parser" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Salahin/youtube-audiobook-title-parser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Salahin/youtube-audiobook-title-parser:Q4_K_M
- SGLang
How to use Salahin/youtube-audiobook-title-parser 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 "Salahin/youtube-audiobook-title-parser" \ --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": "Salahin/youtube-audiobook-title-parser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Salahin/youtube-audiobook-title-parser" \ --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": "Salahin/youtube-audiobook-title-parser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Salahin/youtube-audiobook-title-parser with Ollama:
ollama run hf.co/Salahin/youtube-audiobook-title-parser:Q4_K_M
- Unsloth Desktop
- Pi
How to use Salahin/youtube-audiobook-title-parser with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Salahin/youtube-audiobook-title-parser:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Salahin/youtube-audiobook-title-parser with Docker Model Runner:
docker model run hf.co/Salahin/youtube-audiobook-title-parser:Q4_K_M
- Lemonade
How to use Salahin/youtube-audiobook-title-parser with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Salahin/youtube-audiobook-title-parser:Q4_K_M
Run and chat with the model
lemonade run user.youtube-audiobook-title-parser-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Salahin/youtube-audiobook-title-parser with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
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 Salahin/youtube-audiobook-title-parser:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Salahin/youtube-audiobook-title-parser with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Salahin/youtube-audiobook-title-parser:Q4_K_M
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 "Salahin/youtube-audiobook-title-parser:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Model Card for youtube-audiobook-title-parser
youtube-audiobook-title-parser is a lightweight model fine-tuned from Qwen/Qwen2.5-0.5B-Instruct designed to parse noisy YouTube and audiobook track titles into structured JSON containing the book title, author, and channel or show name.
It reliably separates entities across multi-delimiter titles (|, -, :), handles channel-first and franchise prefix variations (e.g., মিসির আলি, ফেলুদা, ব্যোমকেশ), strips episode noise (1/2, ১ম পর্ব, Part 1), and preserves original Bengali script without unwanted translation or phonetic transliteration.
Available Model Formats
| File | Format | Size | Best For |
|---|---|---|---|
model.safetensors |
FP16 | ~980 MB | Transformers, PyTorch, HF Serverless API, GPU inference |
model-q4_k_m.gguf |
Q4_K_M | ~380 MB | llama.cpp, fast CPU inference, mobile/desktop local apps |
How to Get Started
Option 1: Using Transformers (GPU / Serverless)
import json
import re
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "Salahin/youtube-audiobook-title-parser"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16,
device_map="auto"
)
model.eval()
def parse_title(title: str) -> dict:
messages = [
{
"role": "system",
"content": "Extract book title, author, and channel as JSON. Keep Bengali in Bengali script."
},
{"role": "user", "content": title}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=80,
do_sample=False,
eos_token_id=tokenizer.convert_tokens_to_ids("<|im_end|>")
)
text = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True).strip()
match = re.search(r'\{.*?\}', text, re.DOTALL)
return json.loads(match.group(0)) if match else {"raw": text}
# Example
print(parse_title("হিমুর হাতে কয়েকটি নীলপদ্ম 1/2 | Humayun Ahmed | Golpokothon"))
# Output: {'book_title': 'হিমুর হাতে কয়েকটি নীলপদ্ম', 'author': 'Humayun Ahmed', 'channel': 'Golpokothon'}
Option 2: Using GGUF on CPU (Ultra-Fast & Low Memory)
Install llama-cpp-python:
pip install llama-cpp-python huggingface-hub
import json
import re
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
# Download quantized GGUF binary (~380 MB)
model_path = hf_hub_download(
repo_id="Salahin/youtube-audiobook-title-parser",
filename="model-q4_k_m.gguf"
)
llm = Llama(
model_path=model_path,
n_ctx=512,
n_threads=4, # Adjust to your CPU core count
verbose=False
)
def parse_title_cpu(title: str) -> dict:
prompt = (
"<|im_start|>system\n"
"Extract book title, author, and channel as JSON. Keep Bengali in Bengali script.<|im_end|>\n"
f"<|im_start|>user\n{title}<|im_end|>\n"
"<|im_start|>assistant\n"
)
output = llm(
prompt,
max_tokens=80,
stop=["}", "<|im_end|>"],
temperature=0.0
)
raw = output["choices"][0]["text"].strip()
if not raw.endswith("}"):
raw += "}"
match = re.search(r'\{.*?\}', raw, re.DOTALL)
return json.loads(match.group(0)) if match else {"raw": raw}
# Example
print(parse_title_cpu("Golpokothon Presents | হিমুর হাতে কয়েকটি নীলপদ্ম | হুমায়ূন আহমেদ"))
Training Details
Training Data
The training data is available directly in this repository: dataset.jsonl.
It comprises 600 synthetic and curated title variations addressing real-world edge cases:
- Multi-delimiter patterns (
|,-,:,/) - Leading channel markers (
Channel Presents | Title | Author) - Bengali franchise patterns (মিসির আলি, হিমু, ব্যোমকেশ, ফেলুদা)
- Missing metadata fields (titles without channels or authors)
- Undelimited radio show titles (Sunday Suspense, Midnight Horror Station)
- Noise tokens (
1/2,১ম পর্ব,[HD],Full Audiobook)
Training Procedure
- Base Model:
Qwen/Qwen2.5-0.5B-Instruct - Method: LoRA (Low-Rank Adaptation) with standard sequence-to-sequence loss masking (loss calculated solely on assistant response tokens and EOS)
- Hyperparameters:
r: 16lora_alpha: 32target_modules:["q_proj", "k_proj", "v_proj", "o_proj"]lora_dropout: 0.05learning_rate: 3e-4 (Cosine schedule)epochs: 3optimizer:adamw_torch
Bias, Risks, and Limitations
- Specifically tuned for South Asian / Bengali literature naming conventions and formats.
- Strings that diverge significantly from standard book or audiobook naming structures may produce incomplete metadata fields.
- Downloads last month
- 962