File size: 1,750 Bytes
993d37d |
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 |
---
license: mit
tags:
- llm
- tinyllama
- function-calling
- question-answering
- finetuned
---
# TinyLlama Fine-tuned for Function Calling
This is a fine-tuned version of the [TinyLlama](https://huggingface.co/jzhang38/TinyLlama) model optimized for function calling tasks.
## Model Details
- **Base Model**: [Successmove/tinyllama-function-calling-cpu-optimized](https://huggingface.co/Successmove/tinyllama-function-calling-cpu-optimized)
- **Fine-tuning Data**: [Successmove/combined-function-calling-context-dataset](https://huggingface.co/datasets/Successmove/combined-function-calling-context-dataset)
- **Training Method**: LoRA (Low-Rank Adaptation)
- **Training Epochs**: 3
- **Final Training Loss**: ~0.05
## Usage
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model
base_model_name = "Successmove/tinyllama-function-calling-cpu-optimized"
model = AutoModelForCausalLM.from_pretrained(base_model_name)
# Load the LoRA adapters
model = PeftModel.from_pretrained(model, "path/to/this/model")
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("path/to/this/model")
# Generate text
input_text = "Set a reminder for tomorrow at 9 AM"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
```
## Training Details
This model was fine-tuned using:
- LoRA with r=8
- Learning rate: 2e-4
- Batch size: 4
- Gradient accumulation steps: 2
- 3 training epochs
## Limitations
This is a research prototype and may not be suitable for production use without further evaluation and testing.
## License
This model is licensed under the MIT License. |