migtissera
commited on
Commit
•
6c7ed0f
1
Parent(s):
06f4dcd
Update README.md
Browse files
README.md
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
---
|
2 |
license: llama2
|
|
|
|
|
|
|
|
|
3 |
---
|
4 |
|
|
|
|
|
5 |
All Synthia models are uncensored. Please use it with caution and with best intentions. You are responsible for how you use Synthia.
|
6 |
|
7 |
To evoke generalized Tree of Thought + Chain of Thought reasoning, you may use the following system message:
|
@@ -9,6 +15,39 @@ To evoke generalized Tree of Thought + Chain of Thought reasoning, you may use t
|
|
9 |
Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.
|
10 |
```
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
## Example Usage
|
14 |
|
@@ -20,3 +59,119 @@ USER: How is a rocket launched from the surface of the earth to Low Earth Orbit?
|
|
20 |
ASSISTANT:
|
21 |
```
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: llama2
|
3 |
+
pipeline_tag: text-generation
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
library_name: transformers
|
7 |
---
|
8 |
|
9 |
+
Change from 1.1 -> 1.2: 20% more data than 1.1 and 2x training time.
|
10 |
+
|
11 |
All Synthia models are uncensored. Please use it with caution and with best intentions. You are responsible for how you use Synthia.
|
12 |
|
13 |
To evoke generalized Tree of Thought + Chain of Thought reasoning, you may use the following system message:
|
|
|
15 |
Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.
|
16 |
```
|
17 |
|
18 |
+
# Synthia-70B-v1.2
|
19 |
+
SynthIA (Synthetic Intelligent Agent) is a LLama-2-70B model trained on Orca style datasets. It has been fine-tuned for instruction following as well as having long-form conversations.
|
20 |
+
|
21 |
+
<br>
|
22 |
+
|
23 |
+
![Synthia](https://huggingface.co/migtissera/Synthia-13B/resolve/main/Synthia.jpeg)
|
24 |
+
|
25 |
+
<br>
|
26 |
+
|
27 |
+
<br>
|
28 |
+
|
29 |
+
#### License Disclaimer:
|
30 |
+
|
31 |
+
This model is bound by the license & usage restrictions of the original Llama-2 model, and comes with no warranty or gurantees of any kind.
|
32 |
+
|
33 |
+
<br>
|
34 |
+
|
35 |
+
## Evaluation
|
36 |
+
|
37 |
+
We evaluated Synthia-70B-v1.2 on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI.
|
38 |
+
|
39 |
+
Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
40 |
+
|
41 |
+
||||
|
42 |
+
|:------:|:--------:|:-------:|
|
43 |
+
|**Task**|**Metric**|**Value**|
|
44 |
+
|*arc_challenge*|acc_norm|70.48|
|
45 |
+
|*hellaswag*|acc_norm|86.98|
|
46 |
+
|*mmlu*|acc_norm|70.13|
|
47 |
+
|*truthfulqa_mc*|mc2|58.64|
|
48 |
+
|**Total Average**|-|**71.56**||
|
49 |
+
|
50 |
+
<br>
|
51 |
|
52 |
## Example Usage
|
53 |
|
|
|
59 |
ASSISTANT:
|
60 |
```
|
61 |
|
62 |
+
### Below shows a code example on how to use this model:
|
63 |
+
|
64 |
+
```python
|
65 |
+
import torch, json
|
66 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
67 |
+
|
68 |
+
model_path = "migtissera/Synthia-70B-v1.2"
|
69 |
+
output_file_path = "./Synthia-70B-conversations.jsonl"
|
70 |
+
|
71 |
+
model = AutoModelForCausalLM.from_pretrained(
|
72 |
+
model_path,
|
73 |
+
torch_dtype=torch.float16,
|
74 |
+
device_map="auto",
|
75 |
+
load_in_8bit=False,
|
76 |
+
trust_remote_code=True,
|
77 |
+
)
|
78 |
+
|
79 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
80 |
+
|
81 |
+
|
82 |
+
def generate_text(instruction):
|
83 |
+
tokens = tokenizer.encode(instruction)
|
84 |
+
tokens = torch.LongTensor(tokens).unsqueeze(0)
|
85 |
+
tokens = tokens.to("cuda")
|
86 |
+
|
87 |
+
instance = {
|
88 |
+
"input_ids": tokens,
|
89 |
+
"top_p": 1.0,
|
90 |
+
"temperature": 0.75,
|
91 |
+
"generate_len": 1024,
|
92 |
+
"top_k": 50,
|
93 |
+
}
|
94 |
+
|
95 |
+
length = len(tokens[0])
|
96 |
+
with torch.no_grad():
|
97 |
+
rest = model.generate(
|
98 |
+
input_ids=tokens,
|
99 |
+
max_length=length + instance["generate_len"],
|
100 |
+
use_cache=True,
|
101 |
+
do_sample=True,
|
102 |
+
top_p=instance["top_p"],
|
103 |
+
temperature=instance["temperature"],
|
104 |
+
top_k=instance["top_k"],
|
105 |
+
num_return_sequences=1,
|
106 |
+
)
|
107 |
+
output = rest[0][length:]
|
108 |
+
string = tokenizer.decode(output, skip_special_tokens=True)
|
109 |
+
answer = string.split("USER:")[0].strip()
|
110 |
+
return f"{answer}"
|
111 |
+
|
112 |
+
|
113 |
+
conversation = f"SYSTEM: Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation."
|
114 |
+
|
115 |
+
|
116 |
+
while True:
|
117 |
+
user_input = input("You: ")
|
118 |
+
llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
|
119 |
+
answer = generate_text(llm_prompt)
|
120 |
+
print(answer)
|
121 |
+
conversation = f"{llm_prompt}{answer}"
|
122 |
+
json_data = {"prompt": user_input, "answer": answer}
|
123 |
+
|
124 |
+
## Save your conversation
|
125 |
+
with open(output_file_path, "a") as output_file:
|
126 |
+
output_file.write(json.dumps(json_data) + "\n")
|
127 |
+
|
128 |
+
```
|
129 |
+
|
130 |
+
<br>
|
131 |
+
|
132 |
+
#### Limitations & Biases:
|
133 |
+
|
134 |
+
While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
|
135 |
+
|
136 |
+
Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
|
137 |
+
|
138 |
+
Exercise caution and cross-check information when necessary. This is an uncensored model.
|
139 |
+
|
140 |
+
|
141 |
+
<br>
|
142 |
+
|
143 |
+
### Citiation:
|
144 |
+
|
145 |
+
Please kindly cite using the following BibTeX:
|
146 |
+
|
147 |
+
```
|
148 |
+
@misc{Synthia-70B-v1.2,
|
149 |
+
author = {Migel Tissera},
|
150 |
+
title = {Synthia-70B-v1.2: Synthetic Intelligent Agent},
|
151 |
+
year = {2023},
|
152 |
+
publisher = {GitHub, HuggingFace},
|
153 |
+
journal = {GitHub repository, HuggingFace repository},
|
154 |
+
howpublished = {\url{https://huggingface.co/migtissera/Synthia-13B},
|
155 |
+
}
|
156 |
+
```
|
157 |
+
|
158 |
+
```
|
159 |
+
@misc{mukherjee2023orca,
|
160 |
+
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
161 |
+
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
162 |
+
year={2023},
|
163 |
+
eprint={2306.02707},
|
164 |
+
archivePrefix={arXiv},
|
165 |
+
primaryClass={cs.CL}
|
166 |
+
}
|
167 |
+
```
|
168 |
+
|
169 |
+
```
|
170 |
+
@software{touvron2023llama,
|
171 |
+
title={LLaMA2: Open and Efficient Foundation Language Models},
|
172 |
+
author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
|
173 |
+
journal={arXiv preprint arXiv:2302.13971},
|
174 |
+
year={2023}
|
175 |
+
}
|
176 |
+
```
|
177 |
+
|