THAU 7B - Fine-tuned with LoRA for cognitive reasoning
Browse files
README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- es
|
| 6 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 7 |
+
tags:
|
| 8 |
+
- reasoning
|
| 9 |
+
- code-generation
|
| 10 |
+
- agent
|
| 11 |
+
- mcp
|
| 12 |
+
- tool-calling
|
| 13 |
+
- spanish
|
| 14 |
+
- qwen2
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
library_name: transformers
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# THAU 7B - Cognitive AI Assistant
|
| 20 |
+
|
| 21 |
+
<p align="center">
|
| 22 |
+
<strong>Thinking Human-like Artificial Understanding</strong>
|
| 23 |
+
</p>
|
| 24 |
+
|
| 25 |
+
THAU 7B is a fine-tuned version of Qwen2.5-7B-Instruct, specialized in cognitive reasoning, code generation, and autonomous agent capabilities.
|
| 26 |
+
|
| 27 |
+
## Model Details
|
| 28 |
+
|
| 29 |
+
- **Base Model**: Qwen/Qwen2.5-7B-Instruct
|
| 30 |
+
- **Training Method**: LoRA (r=16, alpha=32)
|
| 31 |
+
- **Parameters**: 7.6B
|
| 32 |
+
- **Context Length**: 4096 tokens
|
| 33 |
+
- **Languages**: English, Spanish
|
| 34 |
+
|
| 35 |
+
## Capabilities
|
| 36 |
+
|
| 37 |
+
| Feature | Status |
|
| 38 |
+
|---------|--------|
|
| 39 |
+
| Code Generation | Full |
|
| 40 |
+
| Chain of Thought | Full |
|
| 41 |
+
| Tool Calling (MCP) | Full |
|
| 42 |
+
| SVG Generation | Full |
|
| 43 |
+
| Accounting/Finance | Full |
|
| 44 |
+
| Multi-language | Spanish/English |
|
| 45 |
+
|
| 46 |
+
## Training Data
|
| 47 |
+
|
| 48 |
+
- 677 unique training examples across 8 categories
|
| 49 |
+
- Programming: Python, JavaScript, Java, Rust, Go, SQL
|
| 50 |
+
- Reasoning: Step-by-step problem solving
|
| 51 |
+
- DevOps: CI/CD, Docker, Kubernetes
|
| 52 |
+
- Accounting: Double-entry bookkeeping, IFRS
|
| 53 |
+
|
| 54 |
+
## Usage
|
| 55 |
+
|
| 56 |
+
### With Transformers
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 60 |
+
|
| 61 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 62 |
+
"luepow/thau-7b",
|
| 63 |
+
torch_dtype="auto",
|
| 64 |
+
device_map="auto"
|
| 65 |
+
)
|
| 66 |
+
tokenizer = AutoTokenizer.from_pretrained("luepow/thau-7b")
|
| 67 |
+
|
| 68 |
+
messages = [
|
| 69 |
+
{"role": "system", "content": "You are THAU, a cognitive AI assistant."},
|
| 70 |
+
{"role": "user", "content": "Explain Python decorators with examples."}
|
| 71 |
+
]
|
| 72 |
+
|
| 73 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 74 |
+
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 75 |
+
|
| 76 |
+
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
|
| 77 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
### With Ollama
|
| 81 |
+
|
| 82 |
+
```bash
|
| 83 |
+
ollama run luepow/thau-7b
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Tool Calling
|
| 87 |
+
|
| 88 |
+
THAU supports JSON-based tool invocation:
|
| 89 |
+
|
| 90 |
+
```json
|
| 91 |
+
<tool_call>{"name": "execute_python", "arguments": {"code": "print(2+2)"}}</tool_call>
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## Limitations
|
| 95 |
+
|
| 96 |
+
- No vision/multimodal capabilities
|
| 97 |
+
- No internal thinking tokens (uses prompting-based CoT)
|
| 98 |
+
- Quality depends on prompt engineering for complex tasks
|
| 99 |
+
|
| 100 |
+
## License
|
| 101 |
+
|
| 102 |
+
Apache 2.0
|
| 103 |
+
|
| 104 |
+
## Citation
|
| 105 |
+
|
| 106 |
+
```bibtex
|
| 107 |
+
@misc{thau-7b,
|
| 108 |
+
author = {Luis Perez},
|
| 109 |
+
title = {THAU 7B: Cognitive AI Assistant},
|
| 110 |
+
year = {2024},
|
| 111 |
+
publisher = {HuggingFace},
|
| 112 |
+
url = {https://huggingface.co/luepow/thau-7b}
|
| 113 |
+
}
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
## Acknowledgments
|
| 117 |
+
|
| 118 |
+
- Qwen Team for the excellent base model
|
| 119 |
+
- Anthropic's Claude for AI pair programming assistance
|
| 120 |
+
- TinyLlama Team for inspiration
|