File size: 2,573 Bytes
d35d8f5
 
 
62967dd
 
 
 
 
 
 
 
 
 
d35d8f5
 
 
 
 
62967dd
 
d35d8f5
 
 
159012f
d35d8f5
159012f
d35d8f5
159012f
 
 
 
 
 
 
 
d35d8f5
 
 
 
 
159012f
 
62967dd
d35d8f5
 
62967dd
 
 
 
 
 
d35d8f5
62967dd
 
d35d8f5
62967dd
 
 
d35d8f5
159012f
 
 
 
 
 
62967dd
 
 
 
159012f
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
library_name: peft
base_model: mistralai/Mistral-7B-Instruct-v0.1
datasets:
- bipulai/skillate_helpdesk
language:
- en
tags:
- fine_tuning
- customer_support
- mistral
- skillate
- Text Generation
---

# Model Card for Model ID


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. 
The fine-tuned model understands the nuances about how the Skillate product works, its navigation, features, monologue and respond accordingly. 



# Instruction Fine-Tuning Example

In order to leverage instruction fine-tuning, your prompt should be surrounded by `[INST]` and `[/INST]` tokens.

E.g.

```python
prompt = "Answer the below query as a customer support assistant about Skillate Product: "
question = "What are the different ways to log in to the product?"
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"
text = f"<s>[INST] {prompt} {question} [/INST] {answer} </s>"
```



## How to Get Started with the Model

```python

from transformers import AutoTokenizer,AutoModelForCausalLM, BitsAndBytesConfig


quantization_config = BitsAndBytesConfig(
        load_in_4bit=True,
        bnb_4bit_quant_type="nf4",
        bnb_4bit_use_double_quant=True,
        bnb_4bit_compute_dtype=bfloat16
    )

tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
tokenizer.pad_token = tokenizer.eos_token

base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1",device_map="auto",quantization_config=quantization_config)
peft_model = PeftModel.from_pretrained(base_model, "bipulai/mistral-7b-v1-skillate-helpdesk",device_map="auto")
peft_model.merge_and_unload()


'''Evaluating on the helpdesk related query'''
system_prompt = "Answer the below query as a customer support assistant about Skillate Product: "
question = "How to configure the job approval chain?"
prompt = f"<s>[INST] {system_prompt} {question} [/INST]"

tokenize = tokenizer(text = [prompt],return_tensors = "pt")
x = peft_model.generate(input_ids = tokenize["input_ids"].to(device),attention_mask = tokenize["attention_mask"].to(device),max_length = 500)
response = tokenizer.batch_decode(x,skip_special_tokens=True)
print(f"Model Output: {reponse}\n\n")
```