ynakashima commited on
Commit
23e0387
·
verified ·
1 Parent(s): 282c303

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -2
README.md CHANGED
@@ -137,10 +137,14 @@ The values are represented by integers ranging from 0 to 4, with 0 being the low
137
  - humor (default: 0)
138
  - creativity (default: 0)
139
 
140
- You can change the attribute values by replacing the default values specified in the chat template:
141
 
142
  ```python
143
- chatbot.tokenizer.chat_template = chatbot.tokenizer.chat_template.replace("complexity: 4", "complexity: 0")
 
 
 
 
144
  ```
145
 
146
  ## Training
 
137
  - humor (default: 0)
138
  - creativity (default: 0)
139
 
140
+ If you want to change attribute values from the default values specified in the template, you can modify them to any values by adding the attribute values to the user messages:
141
 
142
  ```python
143
+ messages = [
144
+ {"role": "user", "content": "User prompt", "helpfulness": 0, "complexity": 0},
145
+ ]
146
+ chatbot.tokenizer.apply_chat_template(messages, tokenize=False)
147
+ # <s>[INST] User prompt [ATTR] helpfulness: 0 correctness: 4 coherence: 4 complexity: 0 verbosity: 4 quality: 4 toxicity: 0 humor: 0 creativity: 0 [/ATTR] [/INST]
148
  ```
149
 
150
  ## Training