File size: 1,498 Bytes
e94ac7e
 
c5026f2
e94ac7e
 
6faa334
e94ac7e
 
6faa334
e94ac7e
6faa334
e94ac7e
 
6faa334
e94ac7e
6faa334
 
e94ac7e
 
 
 
 
6faa334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c5026f2
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
---
library_name: transformers
license: apache-2.0
---

# Model Card for NeuralHermes 2.5 - Mistral 7B


NeuralHermes is based on the teknium/OpenHermes-2.5-Mistral-7B model that has been further fine-tuned with Direct Preference Optimization (DPO) using the Intel/orca_dpo_pairs dataset, reformatted with the ChatML template.

It is directly inspired by the RLHF process described by Intel/neural-chat-7b-v3-1's authors to improve performance.


**IMPORTANT**

- This model was only run for 2 steps before GPU went out of memory. Hence, this is not completely fine-tuned with DPO.
- Secondly, to make it run over a small GPU, I purposefully reduced the parameters (# of LORA adapters, alpha, etc.). The values are therefore not the ideal.



## Uses

You can use the following code to use this model:


import transformers
from transformers import AutoTokenizer

# Format prompt
message = [
    {"role": "system", "content": "You are a helpful assistant chatbot."},
    {"role": "user", "content": "What is a Large Language Model?"}
]
tokenizer = AutoTokenizer.from_pretrained(new_model)
prompt = tokenizer.apply_chat_template(message, add_generation_prompt=True, tokenize=False)

# Create pipeline
pipeline = transformers.pipeline(
    "text-generation",
    model=new_model,
    tokenizer=tokenizer
)

# Generate text
sequences = pipeline(
    prompt,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
    num_return_sequences=1,
    max_length=200,
)
print(sequences[0]['generated_text'])