Instructions to use MightyDragon-Dev/Chinese-Dragon-GPT1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MightyDragon-Dev/Chinese-Dragon-GPT1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MightyDragon-Dev/Chinese-Dragon-GPT1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MightyDragon-Dev/Chinese-Dragon-GPT1") model = AutoModelForCausalLM.from_pretrained("MightyDragon-Dev/Chinese-Dragon-GPT1") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MightyDragon-Dev/Chinese-Dragon-GPT1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MightyDragon-Dev/Chinese-Dragon-GPT1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MightyDragon-Dev/Chinese-Dragon-GPT1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MightyDragon-Dev/Chinese-Dragon-GPT1
- SGLang
How to use MightyDragon-Dev/Chinese-Dragon-GPT1 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 "MightyDragon-Dev/Chinese-Dragon-GPT1" \ --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": "MightyDragon-Dev/Chinese-Dragon-GPT1", "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 "MightyDragon-Dev/Chinese-Dragon-GPT1" \ --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": "MightyDragon-Dev/Chinese-Dragon-GPT1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MightyDragon-Dev/Chinese-Dragon-GPT1 with Docker Model Runner:
docker model run hf.co/MightyDragon-Dev/Chinese-Dragon-GPT1
Chinese-Dragon-GPT1 🐉
Chinese-Dragon-GPT1 is a lightweight, 82.7-million parameter Transformer model trained from scratch on Chinese news data. It follows the GPT-1 (Post-LayerNorm) architecture and was optimized for efficient training and inference on consumer-grade hardware.
Model Details
- Architecture: GPT-1 (Custom Small Configuration)
- Parameters: 82,659,840
- Layers (n_layer): 6
- Hidden Dimension (n_embd): 768
- Attention Heads (n_head): 12
- Context Length (n_positions): 256
- Vocabulary Size: 52,000 (Custom Byte-Level BPE)
- Training Dataset: CLUE TNews (Chinese News headlines)
Training Story ⚙️
This model was trained as part of the MightyDragon-Dev project. Unlike most LLMs trained on massive GPU clusters, this model was trained on an Intel i5-10210U (ThinkPad X13 Laptop) using CPU-only optimization.
- Training Time: ~15 hours
- Total Steps: 12,500
- Final Training Loss: ~0.13
- Hardware: 4 Cores @ 2.2GHz Boost / 16GB RAM
How to Use
You can use this model directly with the Hugging Face pipeline API:
from transformers import pipeline
generator = pipeline(
"text-generation",
model="MightyDragon-Dev/Chinese-Dragon-GPT1"
)
# Example Prompt
prompt = "据报道,"
result = generator(prompt, max_length=50, do_sample=True, top_k=50)
print(result[0]['generated_text'])
- Downloads last month
- 41