Update README.md
Browse files
README.md
CHANGED
|
@@ -4,117 +4,20 @@ license_name: qwen2
|
|
| 4 |
license_link: https://huggingface.co/Qwen/Qwen2-72B/blob/main/LICENSE
|
| 5 |
---
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
I was testing a new feature with the Tess-v2.5 dataset. If you had used the model, you might have noticed that the model generations sometimes would end up with a follow-up question. This is intentional, and was created to provide more of a "natural" conversation.
|
| 16 |
|
| 17 |
-
What had happened earlier was that the stop token wasn't getting properly generated, so the model would go on to answer its own question.
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
# Tess-v2.5.2 (Qwen2-72B)
|
| 23 |
-
|
| 24 |
-
We've created Tess-v2.5.2, the latest state-of-the-art model in the Tess series of Large Language Models (LLMs). Tess, short for Tesoro (<em>Treasure</em> in Italian), is the flagship LLM series created by Migel Tissera. Tess-v2.5.2 brings significant improvements in reasoning capabilities, coding capabilities and mathematics. It is currently the #1 ranked open weight model when evaluated on MMLU (Massive Multitask Language Understanding). It scores higher than all other open weight models including Qwen2-72B-Instruct, Llama3-70B-Instruct, Mixtral-8x22B-Instruct and DBRX-Instruct. Further, when evaluated on MMLU, Tess-v2.5.2 (Qwen2-72B) model outperforms even the frontier closed models Gemini-1.0-Ultra, Gemini-1.5-Pro, Mistral-Large and Claude-3-Sonnet.
|
| 25 |
-
|
| 26 |
-
Tess-v2.5.2 (Qwen2-72B) was fine-tuned over the newly released Qwen2-72B base, using the Tess-v2.5 dataset that contain 300K samples spanning multiple topics, including business and management, marketing, history, social sciences, arts, STEM subjects and computer programming. This dataset was synthetically generated using the [Sensei](https://github.com/migtissera/Sensei) framework, using multiple frontier models such as GPT-4-Turbo, Claude-Opus and Mistral-Large.
|
| 27 |
-
|
| 28 |
-
The compute for this model was generously sponsored by [KindoAI](https://kindo.ai).
|
| 29 |
-
|
| 30 |
-
When evaluated on a subset of AGIEval (Nous), this model compares very well with the godfather GPT-4-0314 model as well.
|
| 31 |
-
|
| 32 |
-
# Training Process
|
| 33 |
-
|
| 34 |
-
Tess-v2.5.2 model was initiated with the base weights of Qwen2-72B. It was then fine-tuned with the Tess-v2.5 dataset, using Axolotl as the training framework. Most of Tess models follow a common fine-tuning methodology: low learning rates, low number of epochs, and uses very high quality and diverse data. This model was fine-tuned on a 4xA100 VM on Microsoft Azure for 4 days. The model has not been aligned with RLHF or DPO.
|
| 35 |
-
|
| 36 |
-
The author believes that model's capabilities seem to come primariliy from the pre-training process. This is the foundation for every fine-tune of Tess models, and preserving the entropy of the base models is of paramount to the author.
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
# Sample code to run inference
|
| 41 |
-
|
| 42 |
-
Note that this model uses ChatML prompt format.
|
| 43 |
-
|
| 44 |
-
```python
|
| 45 |
-
import torch, json
|
| 46 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 47 |
-
from stop_word import StopWordCriteria
|
| 48 |
-
|
| 49 |
-
model_path = "migtissera/Tess-v2.5.2-Qwen2-72B"
|
| 50 |
-
output_file_path = "/home/migel/conversations.jsonl"
|
| 51 |
-
|
| 52 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 53 |
-
model_path,
|
| 54 |
-
torch_dtype=torch.float16,
|
| 55 |
-
device_map="auto",
|
| 56 |
-
load_in_4bit=False,
|
| 57 |
-
trust_remote_code=True,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
| 61 |
-
|
| 62 |
-
terminators = [
|
| 63 |
-
tokenizer.convert_tokens_to_ids("<|im_end|>")
|
| 64 |
-
]
|
| 65 |
-
|
| 66 |
-
def generate_text(instruction):
|
| 67 |
-
tokens = tokenizer.encode(instruction)
|
| 68 |
-
tokens = torch.LongTensor(tokens).unsqueeze(0)
|
| 69 |
-
tokens = tokens.to("cuda")
|
| 70 |
-
|
| 71 |
-
instance = {
|
| 72 |
-
"input_ids": tokens,
|
| 73 |
-
"top_p": 1.0,
|
| 74 |
-
"temperature": 0.75,
|
| 75 |
-
"generate_len": 1024,
|
| 76 |
-
"top_k": 50,
|
| 77 |
-
}
|
| 78 |
-
|
| 79 |
-
length = len(tokens[0])
|
| 80 |
-
with torch.no_grad():
|
| 81 |
-
rest = model.generate(
|
| 82 |
-
input_ids=tokens,
|
| 83 |
-
max_length=length + instance["generate_len"],
|
| 84 |
-
use_cache=True,
|
| 85 |
-
do_sample=True,
|
| 86 |
-
top_p=instance["top_p"],
|
| 87 |
-
temperature=instance["temperature"],
|
| 88 |
-
top_k=instance["top_k"],
|
| 89 |
-
num_return_sequences=1,
|
| 90 |
-
pad_token_id=tokenizer.eos_token_id,
|
| 91 |
-
eos_token_id=terminators,
|
| 92 |
-
)
|
| 93 |
-
output = rest[0][length:]
|
| 94 |
-
string = tokenizer.decode(output, skip_special_tokens=True)
|
| 95 |
-
return f"{string}"
|
| 96 |
-
|
| 97 |
-
conversation = f"""<|im_start|>system\nYou are Tesoro, a helful AI assitant. You always provide detailed answers without hesitation.<|im_end|>\n<|im_start|>user\n"""
|
| 98 |
-
|
| 99 |
-
while True:
|
| 100 |
-
user_input = input("You: ")
|
| 101 |
-
llm_prompt = f"{conversation}{user_input}<|im_end|>\n<|im_start|>assistant\n"
|
| 102 |
-
answer = generate_text(llm_prompt)
|
| 103 |
-
print(answer)
|
| 104 |
-
conversation = f"{llm_prompt}{answer}\n"
|
| 105 |
-
json_data = {"prompt": user_input, "answer": answer}
|
| 106 |
-
|
| 107 |
-
with open(output_file_path, "a") as output_file:
|
| 108 |
-
output_file.write(json.dumps(json_data) + "\n")
|
| 109 |
-
```
|
| 110 |
-
|
| 111 |
-
# Join My General AI Discord (NeuroLattice):
|
| 112 |
-
https://discord.gg/Hz6GrwGFKD
|
| 113 |
-
|
| 114 |
-
# Limitations & Biases:
|
| 115 |
-
|
| 116 |
-
While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
|
| 117 |
|
| 118 |
-
|
|
|
|
| 119 |
|
| 120 |
-
|
|
|
|
| 4 |
license_link: https://huggingface.co/Qwen/Qwen2-72B/blob/main/LICENSE
|
| 5 |
---
|
| 6 |
|
| 7 |
+
Quantized model => https://huggingface.co/migtissera/Tess-v2.5.2-Qwen2-72B
|
| 8 |
|
| 9 |
+
**Quantization Details:**
|
| 10 |
+
Quantization is done using turboderp's ExLlamaV2 v0.1.8.
|
| 11 |
|
| 12 |
+
I use the default calibration datasets and arguments. The repo also includes a "measurement.json" file, which was used during the quantization process.
|
| 13 |
|
| 14 |
+
For models with bits per weight (BPW) over 6.0, I default to quantizing the `lm_head` layer at 8 bits instead of the standard 6 bits.
|
| 15 |
|
|
|
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
**Who are you? What's with these weird BPWs on [insert model here]?**
|
| 21 |
+
I specialize in optimized EXL2 quantization for models in the 70B to 100B+ range, specifically tailored for 48GB VRAM setups. My rig is built using 2 x 3090s with a Ryzen APU (APU used solely for desktop output—no VRAM wasted on the 3090s). I use TabbyAPI for inference, targeting context sizes between 32K and 64K.
|
| 22 |
|
| 23 |
+
Every model I upload includes a `config.yml` file with my ideal TabbyAPI settings. If you're using my config, don’t forget to set `PYTORCH_CUDA_ALLOC_CONF=backend:cudaMallocAsync` to save some VRAM.
|