File size: 2,180 Bytes
3e57ff7
 
ce5b38c
3e57ff7
 
 
 
 
 
 
 
 
 
 
 
76ed64a
3e57ff7
7576d3a
ce5b38c
3e57ff7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8d0ac8a
 
850ff44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8d0ac8a
 
 
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
62
63
64
65
66
67
68
69
70
71
72
73
---
license: mit
base_model: teknium/OpenHermes-2.5-Mistral-7B
datasets:
- rxavier/economicus
language:
- en
tags:
- chatml
- mistral
- instruct
- openhermes
- economics
---

# Taurus 7B 1.0

![image/png](https://i.ibb.co/dGZ50jy/00003-4001299986.png)

## Description

Taurus is an [OpenHermes 2.5](https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B) finetune using the [Economicus dataset](https://huggingface.co/datasets/rxavier/economicus), an instruct dataset synthetically generated from Economics PhD textbooks.

The model was trained for 2 epochs (QLoRA) using [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl). The exact config I used can be found [here](https://huggingface.co/rxavier/Taurus-1.0-Mistral-7B/tree/main/axolotl).

## Prompt format

Taurus uses **ChatML**.

```
<|im_start|>system
System message
<|im_start|>user
User message<|im_end|>
<|im_start|>assistant
```

## Usage

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, GeneratorConfig


model_id = "rxavier/Taurus-7B-1.0"
model = AutoModelForCausalLM.from_pretrained(
    model_path,
    torch_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained(model_path)
generation_config = GenerationConfig(
                bos_token_id=tok.bos_token_id,
                eos_token_id=tok.eos_token_id,
                pad_token_id=tok.pad_token_id,
            )

prompt = "Give me latex formulas for extended euler equations"
system_message = "You are an expert in economics with PhD level knowledge. You are helpful, give thorough and clear explanations, and use equations and formulas where needed."

messages = [{"role": "system",
             "content": system_message},
            {"role": "user",
             "content": prompt}]
tokens = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")

with torch.no_grad():
    outputs = model.generate(inputs=tokens, generation_config=generation_config)
print(tokenizer.decode(outputs["sequences"].cpu().tolist()[0]))
```

## GGUF quants

You can find GGUF quants for llama.cpp [here](https://huggingface.co/rxavier/Taurus-7B-1.0-GGUF).