Instructions to use BatboldSamdan/babybata-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BatboldSamdan/babybata-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BatboldSamdan/babybata-gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BatboldSamdan/babybata-gpt2") model = AutoModelForCausalLM.from_pretrained("BatboldSamdan/babybata-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BatboldSamdan/babybata-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BatboldSamdan/babybata-gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BatboldSamdan/babybata-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BatboldSamdan/babybata-gpt2
- SGLang
How to use BatboldSamdan/babybata-gpt2 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 "BatboldSamdan/babybata-gpt2" \ --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": "BatboldSamdan/babybata-gpt2", "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 "BatboldSamdan/babybata-gpt2" \ --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": "BatboldSamdan/babybata-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use BatboldSamdan/babybata-gpt2 with Docker Model Runner:
docker model run hf.co/BatboldSamdan/babybata-gpt2
|
Download README.md from BatboldSamdan/babybata-gpt2: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/BatboldSamdan/babybata-gpt2/resolve/main/README.md
- Command line
-
hf download hf://BatboldSamdan/babybata-gpt2/README.md
-
curl -L -o README.md https://huggingface.co/BatboldSamdan/babybata-gpt2/resolve/main/README.md
1.66 kB
| license: mit | |
| language: | |
| - en | |
| base_model: openai-community/gpt2 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - chatbot | |
| - portfolio | |
| # BabyBata 1 (GPT-2) 🍼 | |
| The first version of a small assistant for [Batbold Samdan](https://github.com/batbold9182)'s portfolio. GPT-2 small (124M), fine-tuned to answer questions about his projects, skills and contact info. An AI/ML **learning project**, superseded by [BabyBata 2.0](https://huggingface.co/BatboldSamdan/babybata2). | |
| - **Base model:** GPT-2 small | |
| - **Method:** full fine-tuning with the token/position embeddings frozen | |
| - **Data:** ~640 question/answer pairs: hand-written + augmented (one consistent answer per topic, many phrasings, casual variants) | |
| - **Exact facts use slots:** the model writes `{EMAIL}`, `{GITHUB}`, `{GPA}`… and code replaces them (`facts.py` in the repo). Without this, GPT-2 blended the email and GitHub handle into a wrong address. | |
| - **Code:** [github.com/batbold9182/babybata](https://github.com/batbold9182/babybata) | |
| ## Prompt format | |
| ``` | |
| User: <question> | |
| BabyBata: | |
| ``` | |
| The model continues after `BabyBata:` and ends with `<|endoftext|>`. Fill the `{SLOTS}` in the output with `facts.fill()` from the repo. | |
| ## Evaluation (15 questions not in the training data) | |
| | Version | Score | | |
| |---|---| | |
| | v1: 133 hand-written examples | 4/15 | | |
| | v2: + `{SLOTS}` for exact facts | 8/15 | | |
| | v3: + 486 augmented examples | 14/15 | | |
| | v4: more phrasings, fewer epochs | 15/15 | | |
| ## Limitations | |
| GPT-2 memorizes rather than understands: on harder unseen questions v3 scored only ~8/12 and sometimes invented details. BabyBata 2.0 (Qwen + LoRA + grounding) fixes most of this. | |