Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-4.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
library_name: transformers
|
6 |
+
pipeline_tag: text-generation
|
7 |
+
tags:
|
8 |
+
- DeepNight
|
9 |
+
- deepnight-research
|
10 |
+
- Orca
|
11 |
+
- llama-2
|
12 |
+
- llama-2-70b
|
13 |
+
---
|
14 |
+
|
15 |
+
|
16 |
+
# llama-2-70B-inst
|
17 |
+
|
18 |
+
## Model Details
|
19 |
+
|
20 |
+
* **Developed by**: [DeepNight](https://deepnight.tech)
|
21 |
+
* **Backbone Model**: [LLaMA-2](https://github.com/facebookresearch/llama/tree/main)
|
22 |
+
|
23 |
+
## Dataset Details
|
24 |
+
|
25 |
+
### Used Datasets
|
26 |
+
- ElutherAI/pile (30%)
|
27 |
+
- TogetherComputer/Long-Data-Collections
|
28 |
+
|
29 |
+
|
30 |
+
### Prompt Template
|
31 |
+
```
|
32 |
+
### System:
|
33 |
+
{System}
|
34 |
+
### User:
|
35 |
+
{User}
|
36 |
+
### Assistant:
|
37 |
+
{Assistant}
|
38 |
+
```
|
39 |
+
|
40 |
+
## Usage
|
41 |
+
|
42 |
+
```python
|
43 |
+
import torch
|
44 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
45 |
+
tokenizer = AutoTokenizer.from_pretrained("deepnight-nexus/llama2-70b-inst")
|
46 |
+
model = AutoModelForCausalLM.from_pretrained(
|
47 |
+
"deepnight-nexus/llama2-70b-inst",
|
48 |
+
device_map="auto",
|
49 |
+
torch_dtype=torch.float16,
|
50 |
+
load_in_8bit=True,
|
51 |
+
rope_scaling={"type": "dynamic", "factor": 2} # allows handling of longer inputs
|
52 |
+
)
|
53 |
+
prompt = "### User:\nThomas is healthy, but he has to go to the hospital. What could be the reasons?\n\n### Assistant:\n"
|
54 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
55 |
+
del inputs["token_type_ids"]
|
56 |
+
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
57 |
+
output = model.generate(**inputs, streamer=streamer, use_cache=True, max_new_tokens=float('inf'))
|
58 |
+
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
59 |
+
```
|
60 |
+
|
61 |
+
|
62 |
+
## Contact Us
|
63 |
+
### About DeepNight
|
64 |
+
- [DeepNight](https://deepnight.tech) is a company specialized in Large Language Models (LLMs) and AI. We will help you build private LLMs and related applications.
|
65 |
+
If you have a dataset to build domain specific LLMs or make LLM applications, please contact us at ► [click here to contact](mailto:[email protected]?subject=Inquiry%20Regarding%20Custom%20LLM%20Development)
|