Add model card with v2.0 documentation
Browse files
README.md
CHANGED
|
@@ -1,61 +1,55 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- es
|
| 4 |
- en
|
| 5 |
-
license: apache-2.0
|
| 6 |
tags:
|
| 7 |
- llm
|
| 8 |
-
- conversational
|
| 9 |
-
- text-generation
|
| 10 |
-
- thau
|
| 11 |
- self-learning
|
| 12 |
- tool-calling
|
| 13 |
-
|
| 14 |
-
|
|
|
|
| 15 |
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
|
|
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
-
# THAU - Self-Learning Language Model
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
## Model Description
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
### Key Features
|
| 27 |
-
|
| 28 |
-
- **Self-Learning**: Learns from interactions and self-generated Q&A
|
| 29 |
-
- **Tool Calling**: Supports MCP (Model Context Protocol) for tool invocation
|
| 30 |
-
- **Bilingual**: Trained primarily in Spanish with English support
|
| 31 |
-
- **Lightweight**: ~2048M parameters, runs on consumer hardware
|
| 32 |
-
|
| 33 |
-
## Model Architecture
|
| 34 |
-
|
| 35 |
-
| Parameter | Value |
|
| 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 |
## Usage
|
| 61 |
|
|
@@ -67,61 +61,94 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 67 |
model = AutoModelForCausalLM.from_pretrained("luepow/thau")
|
| 68 |
tokenizer = AutoTokenizer.from_pretrained("luepow/thau")
|
| 69 |
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 72 |
-
outputs = model.generate(**inputs,
|
| 73 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 74 |
```
|
| 75 |
|
| 76 |
-
### With Ollama
|
| 77 |
|
| 78 |
```bash
|
| 79 |
-
|
| 80 |
-
ollama
|
| 81 |
-
|
| 82 |
-
# Or create from GGUF
|
| 83 |
-
ollama create thau -f Modelfile
|
| 84 |
```
|
| 85 |
|
| 86 |
-
|
| 87 |
|
| 88 |
-
THAU
|
| 89 |
|
| 90 |
```
|
| 91 |
<tool_call>{"name": "tool_name", "arguments": {"param": "value"}}</tool_call>
|
| 92 |
```
|
| 93 |
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
## Limitations
|
| 97 |
|
| 98 |
-
- Model size limits complex reasoning
|
| 99 |
- May hallucinate on topics outside training data
|
| 100 |
-
- Tool calling accuracy
|
| 101 |
-
- Spanish
|
|
|
|
| 102 |
|
| 103 |
-
##
|
| 104 |
|
| 105 |
-
|
| 106 |
-
-
|
| 107 |
-
-
|
| 108 |
-
-
|
| 109 |
|
| 110 |
## Citation
|
| 111 |
|
| 112 |
```bibtex
|
| 113 |
@misc{thau2024,
|
| 114 |
-
title={THAU: A Self-Learning Language Model},
|
| 115 |
-
author={
|
| 116 |
year={2024},
|
| 117 |
url={https://huggingface.co/luepow/thau}
|
| 118 |
}
|
| 119 |
```
|
| 120 |
|
| 121 |
-
##
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
---
|
| 126 |
|
| 127 |
-
*THAU - Built with incremental learning and
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- es
|
| 5 |
- en
|
|
|
|
| 6 |
tags:
|
| 7 |
- llm
|
|
|
|
|
|
|
|
|
|
| 8 |
- self-learning
|
| 9 |
- tool-calling
|
| 10 |
+
- spanish
|
| 11 |
+
- tinyllama
|
| 12 |
+
- lora
|
| 13 |
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
| 14 |
+
model-index:
|
| 15 |
+
- name: thau
|
| 16 |
+
results: []
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# THAU v2.0 - Self-Learning Language Model
|
| 20 |
|
| 21 |
+
**THAU** (Thinking, Helpful, Autonomous, Understanding) is a self-learning language model fine-tuned from TinyLlama-1.1B with specialized training in tool calling, reasoning, and Spanish.
|
| 22 |
|
| 23 |
## Model Description
|
| 24 |
|
| 25 |
+
| Attribute | Value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|-----------|-------|
|
| 27 |
+
| **Base Model** | TinyLlama-1.1B-Chat-v1.0 |
|
| 28 |
+
| **Parameters** | ~1.1B |
|
| 29 |
+
| **Training Method** | LoRA Fine-tuning |
|
| 30 |
+
| **Final Loss** | 0.43 |
|
| 31 |
+
| **Languages** | Spanish (primary), English |
|
| 32 |
+
| **License** | Apache 2.0 |
|
| 33 |
+
|
| 34 |
+
## Capabilities
|
| 35 |
+
|
| 36 |
+
- **Tool Calling**: Native JSON-based function invocation
|
| 37 |
+
- **Chain of Thought**: Step-by-step reasoning for complex problems
|
| 38 |
+
- **Image Generation**: Prompt engineering for image generation
|
| 39 |
+
- **Spanish Fluency**: Natural and technical conversations
|
| 40 |
+
- **Programming**: Python, JavaScript, Java assistance
|
| 41 |
+
|
| 42 |
+
## Training Data
|
| 43 |
+
|
| 44 |
+
| Category | Examples |
|
| 45 |
+
|----------|----------|
|
| 46 |
+
| Tool Calling | 112 |
|
| 47 |
+
| Spanish Natural/Technical | 52 |
|
| 48 |
+
| Image Generation | 30 |
|
| 49 |
+
| Conversational Spanish | 20 |
|
| 50 |
+
| Chain of Thought Reasoning | 20 |
|
| 51 |
+
| Programming | 30+ |
|
| 52 |
+
| **Total** | **297 specialized examples** |
|
| 53 |
|
| 54 |
## Usage
|
| 55 |
|
|
|
|
| 61 |
model = AutoModelForCausalLM.from_pretrained("luepow/thau")
|
| 62 |
tokenizer = AutoTokenizer.from_pretrained("luepow/thau")
|
| 63 |
|
| 64 |
+
# Chat format
|
| 65 |
+
prompt = """<|system|>
|
| 66 |
+
Eres THAU, un asistente AI inteligente y servicial.</s>
|
| 67 |
+
<|user|>
|
| 68 |
+
Hola, quien eres?</s>
|
| 69 |
+
<|assistant|>
|
| 70 |
+
"""
|
| 71 |
+
|
| 72 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 73 |
+
outputs = model.generate(**inputs, max_length=200, temperature=0.7)
|
| 74 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 75 |
```
|
| 76 |
|
| 77 |
+
### With Ollama (Recommended)
|
| 78 |
|
| 79 |
```bash
|
| 80 |
+
ollama pull luepow/thau
|
| 81 |
+
ollama run luepow/thau
|
|
|
|
|
|
|
|
|
|
| 82 |
```
|
| 83 |
|
| 84 |
+
## Tool Calling Format
|
| 85 |
|
| 86 |
+
THAU uses a JSON-based tool calling format:
|
| 87 |
|
| 88 |
```
|
| 89 |
<tool_call>{"name": "tool_name", "arguments": {"param": "value"}}</tool_call>
|
| 90 |
```
|
| 91 |
|
| 92 |
+
### Available Tools
|
| 93 |
+
|
| 94 |
+
| Tool | Description |
|
| 95 |
+
|------|-------------|
|
| 96 |
+
| `get_current_time` | Get current date/time |
|
| 97 |
+
| `web_search` | Search the internet |
|
| 98 |
+
| `execute_python` | Run Python code |
|
| 99 |
+
| `generate_image` | Generate image from prompt |
|
| 100 |
+
| `read_file` | Read file contents |
|
| 101 |
+
| `list_directory` | List directory contents |
|
| 102 |
+
|
| 103 |
+
### Example
|
| 104 |
+
|
| 105 |
+
**User**: What time is it?
|
| 106 |
+
|
| 107 |
+
**THAU**:
|
| 108 |
+
```
|
| 109 |
+
<tool_call>{"name": "get_current_time", "arguments": {}}</tool_call>
|
| 110 |
+
```
|
| 111 |
|
| 112 |
## Limitations
|
| 113 |
|
| 114 |
+
- Model size limits complex multi-step reasoning
|
| 115 |
- May hallucinate on topics outside training data
|
| 116 |
+
- Tool calling accuracy varies by complexity
|
| 117 |
+
- Spanish is the primary language; English is secondary
|
| 118 |
+
- Best for simple to moderate complexity tasks
|
| 119 |
|
| 120 |
+
## Training Details
|
| 121 |
|
| 122 |
+
- **Full Training**: 3,022 data points, 4,533 steps, loss 0.94
|
| 123 |
+
- **Specialized v2.0**: 297 examples, 745 steps, loss 0.43
|
| 124 |
+
- **Hardware**: Apple Silicon (MPS)
|
| 125 |
+
- **Training Time**: ~7 minutes for specialized phase
|
| 126 |
|
| 127 |
## Citation
|
| 128 |
|
| 129 |
```bibtex
|
| 130 |
@misc{thau2024,
|
| 131 |
+
title={THAU v2.0: A Self-Learning Language Model},
|
| 132 |
+
author={Luis Perez (luepow)},
|
| 133 |
year={2024},
|
| 134 |
url={https://huggingface.co/luepow/thau}
|
| 135 |
}
|
| 136 |
```
|
| 137 |
|
| 138 |
+
## Links
|
| 139 |
+
|
| 140 |
+
- **Ollama**: [luepow/thau](https://ollama.com/luepow/thau)
|
| 141 |
+
- **GitHub**: [luepow/thau](https://github.com/luepow/thau)
|
| 142 |
|
| 143 |
+
## Acknowledgments
|
| 144 |
+
|
| 145 |
+
- **Thomas & Aurora** - Inspiration for the cognitive age progression system
|
| 146 |
+
- **Claude (Anthropic)** - AI pair programming partner
|
| 147 |
+
- **TinyLlama Team** - Excellent base model
|
| 148 |
+
- **Hugging Face** - Model hosting and transformers library
|
| 149 |
|
| 150 |
---
|
| 151 |
|
| 152 |
+
*THAU v2.0 - Built with incremental learning and specialized training*
|
| 153 |
+
|
| 154 |
+
*Dedicated to Thomas & Aurora*
|