Instructions to use fkarnagi/bababoi_test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use fkarnagi/bababoi_test with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0") model = PeftModel.from_pretrained(base_model, "fkarnagi/bababoi_test") - Transformers
How to use fkarnagi/bababoi_test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fkarnagi/bababoi_test") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("fkarnagi/bababoi_test", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fkarnagi/bababoi_test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fkarnagi/bababoi_test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fkarnagi/bababoi_test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fkarnagi/bababoi_test
- SGLang
How to use fkarnagi/bababoi_test 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 "fkarnagi/bababoi_test" \ --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": "fkarnagi/bababoi_test", "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 "fkarnagi/bababoi_test" \ --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": "fkarnagi/bababoi_test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fkarnagi/bababoi_test with Docker Model Runner:
docker model run hf.co/fkarnagi/bababoi_test
File size: 2,516 Bytes
7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe 2854316 7308dbe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | ---
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:TinyLlama/TinyLlama-1.1B-Chat-v1.0
- lora
- transformers
license: apache-2.0
language:
- en
---
# bababoi_test
A fine-tuned version of [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) using LoRA (Low-Rank Adaptation) on a small instruction-following dataset.
## Model Details
| Property | Value |
|----------|-------|
| **Base Model** | [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) |
| **Fine-tuning Method** | LoRA (Low-Rank Adaptation) |
| **LoRA Rank** | 16 |
| **LoRA Alpha** | 16 |
| **Trainable Parameters** | ~12.6M (1.13% of total) |
| **Dataset Size** | 20 instruction-following examples |
| **Training Epochs** | 10 |
| **Learning Rate** | 2e-4 |
| **Hardware** | Apple M4 GPU (MPS) |
## Training Details
This model was trained on a tiny Alpaca-format dataset covering basic factual Q&A, grammar, translation, and simple arithmetic. It is intended as a **tutorial/demo** for learning fine-tuning workflows rather than production use.
### Training Scripts
- `train.py` — Python training script with LoRA + HuggingFace Trainer
- `inference.py` — Interactive inference script
- `train_cli.sh` / `infer_cli.sh` — Shell wrappers
## How to Use
### Load the LoRA Adapter
```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
adapter = "fkarnagi/bababoi_test"
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype="auto")
model = PeftModel.from_pretrained(model, adapter)
tokenizer = AutoTokenizer.from_pretrained(adapter)
```
### Inference
```python
prompt = "What is the capital of France?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
## Limitations
- Trained on only 20 examples — will overfit and memorize answers
- Not suitable for production or real-world tasks
- Designed for educational purposes only
## Acknowledgements
- Base model: [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0)
- Fine-tuning framework: [HuggingFace PEFT](https://github.com/huggingface/peft)
- Training tutorial: [Unsloth](https://github.com/unslothai/unsloth)
### Framework versions
- PEFT 0.19.1 |