migtissera commited on
Commit
2e8877b
1 Parent(s): 5719c28

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +108 -5
README.md CHANGED
@@ -1,5 +1,108 @@
1
- ---
2
- license: other
3
- license_name: qwen2
4
- license_link: https://huggingface.co/Qwen/Qwen2-72B/blob/main/LICENSE
5
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: qwen2
4
+ license_link: https://huggingface.co/Qwen/Qwen2-72B/blob/main/LICENSE
5
+ ---
6
+
7
+ # Tess-v2.5.2 (Qwen2-72B)
8
+
9
+ ![Tess-v2.5](https://huggingface.co/migtissera/Tess-v2.5-Qwen2-72B/resolve/main/Tess-v2.5.png)
10
+
11
+
12
+ 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.
13
+
14
+ 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.
15
+
16
+ The compute for this model was generously sponsored by [KindoAI](https://kindo.ai).
17
+
18
+ When evaluated on a subset of AGIEval (Nous), this model compares very well with the godfather GPT-4-0314 model as well.
19
+
20
+ # Training Process
21
+
22
+ 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.
23
+
24
+ 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.
25
+
26
+
27
+
28
+ # Sample code to run inference
29
+
30
+ Note that this model uses ChatML prompt format.
31
+
32
+ ```python
33
+ import torch, json
34
+ from transformers import AutoModelForCausalLM, AutoTokenizer
35
+ from stop_word import StopWordCriteria
36
+
37
+ model_path = "migtissera/Tess-v2.5.2-Qwen2-72B"
38
+ output_file_path = "/home/migel/conversations.jsonl"
39
+
40
+ model = AutoModelForCausalLM.from_pretrained(
41
+ model_path,
42
+ torch_dtype=torch.float16,
43
+ device_map="auto",
44
+ load_in_4bit=False,
45
+ trust_remote_code=True,
46
+ )
47
+
48
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
49
+
50
+ terminators = [
51
+ tokenizer.convert_tokens_to_ids("<|im_end|>")
52
+ ]
53
+
54
+ def generate_text(instruction):
55
+ tokens = tokenizer.encode(instruction)
56
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
57
+ tokens = tokens.to("cuda")
58
+
59
+ instance = {
60
+ "input_ids": tokens,
61
+ "top_p": 1.0,
62
+ "temperature": 0.75,
63
+ "generate_len": 1024,
64
+ "top_k": 50,
65
+ }
66
+
67
+ length = len(tokens[0])
68
+ with torch.no_grad():
69
+ rest = model.generate(
70
+ input_ids=tokens,
71
+ max_length=length + instance["generate_len"],
72
+ use_cache=True,
73
+ do_sample=True,
74
+ top_p=instance["top_p"],
75
+ temperature=instance["temperature"],
76
+ top_k=instance["top_k"],
77
+ num_return_sequences=1,
78
+ pad_token_id=tokenizer.eos_token_id,
79
+ eos_token_id=terminators,
80
+ )
81
+ output = rest[0][length:]
82
+ string = tokenizer.decode(output, skip_special_tokens=True)
83
+ return f"{string}"
84
+
85
+ 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"""
86
+
87
+ while True:
88
+ user_input = input("You: ")
89
+ llm_prompt = f"{conversation}{user_input}<|im_end|>\n<|im_start|>assistant\n"
90
+ answer = generate_text(llm_prompt)
91
+ print(answer)
92
+ conversation = f"{llm_prompt}{answer}\n"
93
+ json_data = {"prompt": user_input, "answer": answer}
94
+
95
+ with open(output_file_path, "a") as output_file:
96
+ output_file.write(json.dumps(json_data) + "\n")
97
+ ```
98
+
99
+ # Join My General AI Discord (NeuroLattice):
100
+ https://discord.gg/Hz6GrwGFKD
101
+
102
+ # Limitations & Biases:
103
+
104
+ While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
105
+
106
+ Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
107
+
108
+ Exercise caution and cross-check information when necessary. This is an uncensored model.