Instructions to use AL-GR/Forge-Qwen2.5-0.5B-s1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AL-GR/Forge-Qwen2.5-0.5B-s1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AL-GR/Forge-Qwen2.5-0.5B-s1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AL-GR/Forge-Qwen2.5-0.5B-s1") model = AutoModelForCausalLM.from_pretrained("AL-GR/Forge-Qwen2.5-0.5B-s1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AL-GR/Forge-Qwen2.5-0.5B-s1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AL-GR/Forge-Qwen2.5-0.5B-s1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AL-GR/Forge-Qwen2.5-0.5B-s1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AL-GR/Forge-Qwen2.5-0.5B-s1
- SGLang
How to use AL-GR/Forge-Qwen2.5-0.5B-s1 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 "AL-GR/Forge-Qwen2.5-0.5B-s1" \ --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": "AL-GR/Forge-Qwen2.5-0.5B-s1", "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 "AL-GR/Forge-Qwen2.5-0.5B-s1" \ --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": "AL-GR/Forge-Qwen2.5-0.5B-s1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AL-GR/Forge-Qwen2.5-0.5B-s1 with Docker Model Runner:
docker model run hf.co/AL-GR/Forge-Qwen2.5-0.5B-s1
Configuration Parsing Warning:Config file tokenizer_config.json cannot be fetched (too big)
Forge-Qwen2.5-0.5B-s1
This model is initialized from the pre-trained Qwen/Qwen2.5-0.5B and fine-tuned on the AL-GR/AL-GR-v1 dataset using the FORGE framework for 1 epoch.
It is presented in the paper FORGE: Forming Semantic Identifiers for Generative Retrieval in Industrial Datasets.
- GitHub Repository: https://github.com/selous123/al_sid
- Project Page: https://huggingface.co/AL-GR
Evaluation Results on AL-GR/AL-GR-v1
| Model | HR@20 | HR@100 | HR@500 | HR@1000 |
|---|---|---|---|---|
| Forge-Qwen 2.5-0.5B-Base-s1 | 0.0506 | 0.1277 | 0.2602 | 0.3068 |
| Forge-T5-Base-s1 | 0.0284 | 0.0689 | 0.1372 | 0.1557 |
Note: HR@K denotes Hit Rate at K — the proportion of test queries for which the correct answer appears in the top-K retrieved/generated results.
Usage
1. Download the Model
You can download this model locally using the huggingface_hub library:
import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com" # Optional: use mirror for faster download in some regions
os.environ["KMP_DUPLICATE_LIB_OK"] = "True"
from huggingface_hub import snapshot_download
snapshot_download(
repo_id='AL-GR/Forge-Qwen2.5-0.5B-s1',
local_dir='{YOUR_LOCAL_DIR}', # Replace with your desired local path
local_dir_use_symlinks=False,
)
For more details about the training setup, dataset, or evaluation protocol, please refer to the FORGE framework repository.
Citation
@article{fu2025forge,
title={FORGE: Forming Semantic Identifiers for Generative Retrieval in Industrial Datasets},
author={Fu, Kairui and Zhang, Tao and Xiao, Shuwen and Wang, Ziyang and Zhang, Xinming and Zhang, Chenchi and Yan, Yuliang and Zheng, Junjun and others},
journal={arXiv preprint arXiv:2509.20904},
year={2025}
}
- Downloads last month
- 76