Instructions to use sid22669/TinyLlama-Physics with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use sid22669/TinyLlama-Physics with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("sid22669/TinyLlama-Physics") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use sid22669/TinyLlama-Physics with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "sid22669/TinyLlama-Physics"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "sid22669/TinyLlama-Physics" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sid22669/TinyLlama-Physics", "messages": [ {"role": "user", "content": "Hello"} ] }'
rquest details about fintuning
Hello. I am really interested in your finetuned tinyllama and it is great.
Now, I am fine-tuning Tinyllama on another dataset.
Could you please share your fintuning details?
Yes, the model was first converted to the MLX format to enable training on Mac. I then fine-tuned it using the Alpaca dataset focused on physics. To optimize the training process, I applied PEFT (Parameter-Efficient Fine-Tuning) by adding adapters to the base model and trained only those adapters.
The results were promising in terms of structured and well-formatted outputs. However, the model still struggled with delivering accurate information, particularly in domain-specific details.
Hope this helps!
Thank you for your reply. And what does the "alpca dataset focused on physics" mean?
And how many epoches do you use?