|
--- |
|
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). |