Instructions to use Gil-tester/tpai-lora-cerebro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Gil-tester/tpai-lora-cerebro with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "Gil-tester/tpai-lora-cerebro") - Transformers
How to use Gil-tester/tpai-lora-cerebro with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Gil-tester/tpai-lora-cerebro") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Gil-tester/tpai-lora-cerebro", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Gil-tester/tpai-lora-cerebro with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gil-tester/tpai-lora-cerebro" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gil-tester/tpai-lora-cerebro", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Gil-tester/tpai-lora-cerebro
- SGLang
How to use Gil-tester/tpai-lora-cerebro 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 "Gil-tester/tpai-lora-cerebro" \ --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": "Gil-tester/tpai-lora-cerebro", "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 "Gil-tester/tpai-lora-cerebro" \ --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": "Gil-tester/tpai-lora-cerebro", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Gil-tester/tpai-lora-cerebro with Docker Model Runner:
docker model run hf.co/Gil-tester/tpai-lora-cerebro
TPAI LoRA - Cerebro Interno
LoRA adapter for Qwen/Qwen2.5-0.5B-Instruct, trained as the "cerebro interno" (internal brain) for the TPAI (Teaching People AI) system.
Model Details
- Base Model: Qwen/Qwen2.5-0.5B-Instruct
- Adapter Type: LoRA (PEFT)
- LoRA Rank (r): 16
- LoRA Alpha: 32
- Target Modules: q_proj, k_proj, o_proj, v_proj
- Task Type: Causal Language Modeling
Training Details
- Training Samples: 1194+
- Epochs: 3
- Training Duration: ~8.5 hours
- Final Loss: 1.659
- Dataset: Multi-language programming assistant responses (TeachingPeopleAI/tpai-training-data)
- LoRA Dropout: 0.05
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "Gil-tester/tpai-lora-cerebro")
# Generate response
input_text = "User: Explain quantum computing\nAssistant:"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))
Integration with TPAI
This model serves as the "cerebro interno" in the TPAI system, providing:
- Primary language generation
- Low-latency responses via local inference
- Cost-effective operation on HF Spaces
Framework Versions
- PEFT 0.18.1
- Downloads last month
- 15