Update README.md
Browse files
README.md
CHANGED
@@ -15,22 +15,31 @@ tags:
|
|
15 |
|
16 |
# Model Card for Model ID
|
17 |
|
18 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
19 |
|
20 |
This is the fine tuned model which got further trained on the top of base model Mistral-7B-v0.1 on the Skillate customer support dataset.
|
21 |
The fine-tuned model understands the nuances about how the Skillate product works, its navigation, features, monologue and respond accordingly.
|
22 |
|
23 |
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
## Instruction format
|
29 |
|
30 |
-
In order to leverage instruction fine-tuning, your prompt should be surrounded by [INST] and [/INST] tokens.
|
31 |
|
32 |
## How to Get Started with the Model
|
33 |
|
|
|
|
|
34 |
from transformers import AutoTokenizer,AutoModelForCausalLM, BitsAndBytesConfig
|
35 |
|
36 |
|
@@ -48,7 +57,14 @@ base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct
|
|
48 |
peft_model = PeftModel.from_pretrained(base_model, "bipulai/mistral-7b-v1-skillate-helpdesk",device_map="auto")
|
49 |
peft_model.merge_and_unload()
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
tokenize = tokenizer(text = [prompt],return_tensors = "pt")
|
52 |
x = peft_model.generate(input_ids = tokenize["input_ids"].to(device),attention_mask = tokenize["attention_mask"].to(device),max_length = 500)
|
53 |
response = tokenizer.batch_decode(x,skip_special_tokens=True)
|
54 |
print(f"Model Output: {reponse}\n\n")
|
|
|
|
15 |
|
16 |
# Model Card for Model ID
|
17 |
|
|
|
18 |
|
19 |
This is the fine tuned model which got further trained on the top of base model Mistral-7B-v0.1 on the Skillate customer support dataset.
|
20 |
The fine-tuned model understands the nuances about how the Skillate product works, its navigation, features, monologue and respond accordingly.
|
21 |
|
22 |
|
23 |
|
24 |
+
# Instruction Fine-Tuning Example
|
25 |
|
26 |
+
In order to leverage instruction fine-tuning, your prompt should be surrounded by `[INST]` and `[/INST]` tokens.
|
27 |
|
28 |
+
E.g.
|
29 |
+
|
30 |
+
```python
|
31 |
+
prompt = "Answer the below query as a customer support assistant about Skillate Product: "
|
32 |
+
question = "What are the different ways to log in to the product?"
|
33 |
+
answer = "You can log in to Skillate in any of the three methods here: [https://help.skillate.com/en/support/solutions/articles/82000881022](https://help.skillate.com/en/support/solutions/articles/82000881022) The conventional method of entering a username and password Using SSO (Single Sign-On) login via Google Using SSO (Single Sign-On) login via Microsoft"
|
34 |
+
text = f"<s>[INST] {prompt} {question} [/INST] {answer} </s>"
|
35 |
+
```
|
36 |
|
|
|
37 |
|
|
|
38 |
|
39 |
## How to Get Started with the Model
|
40 |
|
41 |
+
```python
|
42 |
+
|
43 |
from transformers import AutoTokenizer,AutoModelForCausalLM, BitsAndBytesConfig
|
44 |
|
45 |
|
|
|
57 |
peft_model = PeftModel.from_pretrained(base_model, "bipulai/mistral-7b-v1-skillate-helpdesk",device_map="auto")
|
58 |
peft_model.merge_and_unload()
|
59 |
|
60 |
+
|
61 |
+
'''Evaluating on the helpdesk related query'''
|
62 |
+
system_prompt = "Answer the below query as a customer support assistant about Skillate Product: "
|
63 |
+
question = "How to configure the job approval chain?"
|
64 |
+
prompt = f"<s>[INST] {system_prompt} {question} [/INST]"
|
65 |
+
|
66 |
tokenize = tokenizer(text = [prompt],return_tensors = "pt")
|
67 |
x = peft_model.generate(input_ids = tokenize["input_ids"].to(device),attention_mask = tokenize["attention_mask"].to(device),max_length = 500)
|
68 |
response = tokenizer.batch_decode(x,skip_special_tokens=True)
|
69 |
print(f"Model Output: {reponse}\n\n")
|
70 |
+
```
|