migtissera
commited on
Commit
•
9c5ca9c
1
Parent(s):
9b624e2
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,191 @@
|
|
1 |
---
|
2 |
license: llama2
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: llama2
|
3 |
+
pipeline_tag: text-generation
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
library_name: transformers
|
7 |
---
|
8 |
+
|
9 |
+
# Synthia-7B
|
10 |
+
|
11 |
+
SynthIA (Synthetic Intelligent Agent) is a LLama2-13B model trained on Orca style datasets. It has been fine-tuned for instruction following as well as having long-form conversations.
|
12 |
+
|
13 |
+
<br>
|
14 |
+
|
15 |
+
![Synthia](https://huggingface.co/migtissera/Synthia-13B/resolve/main/Synthia.jpeg)
|
16 |
+
|
17 |
+
<br>
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
<br>
|
23 |
+
|
24 |
+
#### license disclaimer:
|
25 |
+
|
26 |
+
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.
|
27 |
+
|
28 |
+
<br>
|
29 |
+
|
30 |
+
## evaluation
|
31 |
+
|
32 |
+
We evaluated Synthia-13B on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI.
|
33 |
+
|
34 |
+
Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
<br>
|
39 |
+
|
40 |
+
## example esage
|
41 |
+
|
42 |
+
Here is prompt format
|
43 |
+
|
44 |
+
```
|
45 |
+
SYSTEM: You are Synthia. As a an AI intelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually.
|
46 |
+
USER: How is a rocket launched from the surface of the earth to Low Earth Orbit?
|
47 |
+
ASSISTANT:
|
48 |
+
```
|
49 |
+
|
50 |
+
Below shows a code example on how to use this model
|
51 |
+
|
52 |
+
```python
|
53 |
+
import torch, json
|
54 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
55 |
+
|
56 |
+
model_path = "migtissera/Synthia-13B"
|
57 |
+
output_file_path = "./Synthia-13B-conversations.jsonl"
|
58 |
+
|
59 |
+
model = AutoModelForCausalLM.from_pretrained(
|
60 |
+
model_path,
|
61 |
+
torch_dtype=torch.float16,
|
62 |
+
device_map="auto",
|
63 |
+
load_in_8bit=False,
|
64 |
+
trust_remote_code=True,
|
65 |
+
)
|
66 |
+
|
67 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
68 |
+
|
69 |
+
|
70 |
+
def generate_text(instruction):
|
71 |
+
tokens = tokenizer.encode(instruction)
|
72 |
+
tokens = torch.LongTensor(tokens).unsqueeze(0)
|
73 |
+
tokens = tokens.to("cuda")
|
74 |
+
|
75 |
+
instance = {
|
76 |
+
"input_ids": tokens,
|
77 |
+
"top_p": 1.0,
|
78 |
+
"temperature": 0.75,
|
79 |
+
"generate_len": 1024,
|
80 |
+
"top_k": 50,
|
81 |
+
}
|
82 |
+
|
83 |
+
length = len(tokens[0])
|
84 |
+
with torch.no_grad():
|
85 |
+
rest = model.generate(
|
86 |
+
input_ids=tokens,
|
87 |
+
max_length=length + instance["generate_len"],
|
88 |
+
use_cache=True,
|
89 |
+
do_sample=True,
|
90 |
+
top_p=instance["top_p"],
|
91 |
+
temperature=instance["temperature"],
|
92 |
+
top_k=instance["top_k"],
|
93 |
+
num_return_sequences=1,
|
94 |
+
)
|
95 |
+
output = rest[0][length:]
|
96 |
+
string = tokenizer.decode(output, skip_special_tokens=True)
|
97 |
+
answer = string.split("USER:")[0].strip()
|
98 |
+
return f"{answer}"
|
99 |
+
|
100 |
+
|
101 |
+
conversation = f"SYSTEM: As a an AI superintelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually."
|
102 |
+
|
103 |
+
|
104 |
+
while True:
|
105 |
+
user_input = input("You: ")
|
106 |
+
llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
|
107 |
+
answer = generate_text(llm_prompt)
|
108 |
+
print(answer)
|
109 |
+
conversation = f"{llm_prompt}{answer}"
|
110 |
+
json_data = {"prompt": user_input, "answer": answer}
|
111 |
+
|
112 |
+
## Save your conversation
|
113 |
+
with open(output_file_path, "a") as output_file:
|
114 |
+
output_file.write(json.dumps(json_data) + "\n")
|
115 |
+
|
116 |
+
```
|
117 |
+
|
118 |
+
<br>
|
119 |
+
|
120 |
+
#### limitations & biases:
|
121 |
+
|
122 |
+
While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
|
123 |
+
|
124 |
+
Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
|
125 |
+
|
126 |
+
Exercise caution and cross-check information when necessary.
|
127 |
+
|
128 |
+
|
129 |
+
<br>
|
130 |
+
|
131 |
+
### citiation:
|
132 |
+
|
133 |
+
Please kindly cite using the following BibTeX:
|
134 |
+
|
135 |
+
```
|
136 |
+
@misc{Synthia-13B,
|
137 |
+
author = {Migel Tissera},
|
138 |
+
title = {Synthia-13B: Synthetic Intelligent Agent},
|
139 |
+
year = {2023},
|
140 |
+
publisher = {GitHub, HuggingFace},
|
141 |
+
journal = {GitHub repository, HuggingFace repository},
|
142 |
+
howpublished = {\url{https://huggingface.co/migtissera/Synthia-13B},
|
143 |
+
}
|
144 |
+
```
|
145 |
+
|
146 |
+
```
|
147 |
+
@misc{mukherjee2023orca,
|
148 |
+
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
149 |
+
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
150 |
+
year={2023},
|
151 |
+
eprint={2306.02707},
|
152 |
+
archivePrefix={arXiv},
|
153 |
+
primaryClass={cs.CL}
|
154 |
+
}
|
155 |
+
```
|
156 |
+
|
157 |
+
```
|
158 |
+
@software{touvron2023llama,
|
159 |
+
title={LLaMA2: Open and Efficient Foundation Language Models},
|
160 |
+
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},
|
161 |
+
journal={arXiv preprint arXiv:2302.13971},
|
162 |
+
year={2023}
|
163 |
+
}
|
164 |
+
```
|
165 |
+
|
166 |
+
## Example Output
|
167 |
+
```
|
168 |
+
You: How is a rocket launched from the surface of the earth to Low Earth Orbit?
|
169 |
+
|
170 |
+
A rocket is launched from the surface of the Earth to Low Earth Orbit (LEO) by utilizing the principles of rocketry. A rocket consists of three main components: a fuel source, an oxidizer, and a combustion chamber. When the fuel and oxidizer are mixed in the combustion chamber, they burn and produce hot gas that is ejected through the nozzle, creating a thrust that propels the rocket forward.
|
171 |
+
|
172 |
+
To launch a rocket to LEO, the rocket must first gain sufficient velocity and altitude. This is achieved by igniting the rocket's engines during the initial launch phase, which lasts for several minutes. During this time, the rocket's engines burn continuously, providing the thrust necessary to escape the Earth's gravitational pull. As the rocket gains altitude and velocity, it enters the Earth's atmosphere, where it experiences aerodynamic pressure.
|
173 |
+
|
174 |
+
To overcome this pressure, the rocket's engines are designed to produce thrust in a specific direction, which counteracts the force of the incoming air. This is known as aerodynamic control. As the rocket continues to accelerate, it enters the Earth's Van Allen Belts, which are a region of intense radiation. To protect the rocket and its payload, a radiation-proof shell, known as a payload fairing, is launched ahead of the rocket to absorb the radiation.
|
175 |
+
|
176 |
+
Once the rocket has reached LEO, its engines are shut off, and the payload is deployed. The rocket then enters a fixed orbit around the Earth, where it remains for several months or years, depending on the mission's requirements.
|
177 |
+
|
178 |
+
Overall, the process of launching a rocket from the surface of the Earth to LEO is complex and requires advanced technology and engineering. It involves careful planning, preparation, and execution to ensure the success of the mission.
|
179 |
+
|
180 |
+
You: What's the velocity required?
|
181 |
+
|
182 |
+
The velocity required to place a rocket into Low Earth Orbit (LEO) depends on several factors, including the mass of the rocket and its payload, the altitude of the orbit, and the gravitational pull of the Earth. Generally, a rocket must reach a speed of around 7.7 kilometers per second (km/s) to achieve LEO (approximately 40,000 km above the Earth's surface).
|
183 |
+
However, this speed is relative to the Earth's surface, so the rocket must achieve a velocity of approximately 11.3 km/s relative to the Earth's center of mass. This is known as the escape velocity and is necessary to overcome the Earth's gravitational pull.
|
184 |
+
To achieve this velocity, the rocket's engines must be capable of generating a large amount of thrust. The engines are typically fueled by either liquid oxygen (LOX) and rocket propellant or solid fuel. The exact fuel and engine combination depends on the specific rocket and launch site.
|
185 |
+
|
186 |
+
Once the rocket has reached the necessary velocity, it must also have sufficient fuel and propellant to maintain its altitude and orbit. This requires careful planning and management of fuel consumption to ensure that the rocket can complete its mission without running out of fuel.
|
187 |
+
|
188 |
+
Overall, launching a rocket into LEO is a complex process that involves careful planning, preparation, and execution. Achieving the necessary velocity and maintaining the rocket's orbit requires a high level of technical expertise and precision.
|
189 |
+
|
190 |
+
|
191 |
+
```
|