sreeramajay
commited on
Commit
•
7dbbc8c
1
Parent(s):
a697128
updated model card
Browse files
README.md
CHANGED
@@ -6,4 +6,43 @@ language:
|
|
6 |
- en
|
7 |
---
|
8 |
|
9 |
-
Applied DPO to TinyLlama-1.1B-Chat-v1.0 using orca_dpo_pairs dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
- en
|
7 |
---
|
8 |
|
9 |
+
Applied DPO to TinyLlama-1.1B-Chat-v1.0 using orca_dpo_pairs dataset
|
10 |
+
|
11 |
+
This is only experimental Model created by following instruction from the nice Blog [Fine-tune a Mistral-7b model with Direct Preference Optimization
|
12 |
+
](https://towardsdatascience.com/fine-tune-a-mistral-7b-model-with-direct-preference-optimization-708042745aac)
|
13 |
+
|
14 |
+
You can run this model using the following code:
|
15 |
+
|
16 |
+
```
|
17 |
+
# Format prompt
|
18 |
+
message = [
|
19 |
+
{"role": "system", "content": "You are a helpful assistant chatbot."},
|
20 |
+
{"role": "user", "content": "What is a Large Language Model?"}
|
21 |
+
]
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained(new_model)
|
23 |
+
prompt = tokenizer.apply_chat_template(message, add_generation_prompt=True, tokenize=False)
|
24 |
+
|
25 |
+
# Create pipeline
|
26 |
+
pipeline = transformers.pipeline(
|
27 |
+
"text-generation",
|
28 |
+
model=new_model,
|
29 |
+
tokenizer=tokenizer
|
30 |
+
)
|
31 |
+
|
32 |
+
# Generate text
|
33 |
+
sequences = pipeline(
|
34 |
+
prompt,
|
35 |
+
do_sample=True,
|
36 |
+
temperature=0.7,
|
37 |
+
top_p=0.9,
|
38 |
+
num_return_sequences=1,
|
39 |
+
max_length=200,
|
40 |
+
)
|
41 |
+
print(sequences[0]['generated_text'])
|
42 |
+
# <|system|>
|
43 |
+
# You are a helpful assistant chatbot.</s>
|
44 |
+
# <|user|>
|
45 |
+
# What is a Large Language Model?</s>
|
46 |
+
# <|assistant|>
|
47 |
+
# A Large Language Model (LLM) is a type of deep learning model that processes large amounts of text or data to improve the accuracy of natural language processing tasks such as sentiment analysis, machine translation, and question answering. LLMs are trained using large datasets, which allow them to generalize better and have better performance compared to traditional machine learning models. They are capable of handling vast amounts of text and can learn complex relationships between words, phrases, and sentences, making them an essential tool for natural language processing.
|
48 |
+
```
|