File size: 1,940 Bytes
8142f98
 
 
 
 
 
ade2fdb
 
 
 
 
 
 
 
 
 
2be08a8
ade2fdb
 
 
 
9e3d72e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ade2fdb
9e3d72e
ade2fdb
9e3d72e
 
ade2fdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: mit
datasets:
- teknium/openhermes
language:
- en
tags:
- llama
- llama-2
- instruct
- finetune 
- OpenHermes
---

## llama2-7b-openhermes-15k-mini

It is a 4-bit qlora refinement of llama-v2-guanaco, fine tuned on the 15k rows of Hermes dataset.

## Usage:

```
from transformers import AutoTokenizer
import transformers
import torch

model = "aloobun/llama2-7b-openhermes-15k-mini"
prompt = "What are large language models?"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

sequences = pipeline(
    f'[INST] {prompt} [/INST]',
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
    max_length=200,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")
```

### Output:

```
Result: [INST] What are large language models? [/INST] Large language models are artificial intelligence systems that can be trained on vast amounts of text to generate human-like language. Libraries of natural language processing (NLP) algorithms like BERT and GPT have allowed these systems to learn and improve their capacity for language understanding and generation. These language models have found applications in natural language translation, text summarization, chatbots, and even creative writing. They can help in tasks like predicting the next word in a sentence or even generating a whole text based on a given topic or prompt. Large language models have the potential to revolutionize many industries, from customer support to content creation and beyond. However, their use and development raise important ethical and societal questions, such as the impact on employment or the potential misuse of generated content. As AI technology continues to advance, the role and capabilities of large language models will continue to evolve.
```