Shaltiel commited on
Commit
7b95563
โ€ข
1 Parent(s): 44cbd88

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -31,15 +31,15 @@ In order to leverage instruction fine-tuning, your prompt should be surrounded b
31
 
32
  E.g.
33
  ```
34
- text = """<s>[INST] What is your favourite condiment? [/INST]
35
- Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s>[INST] Do you have mayonnaise recipes? [/INST]"
36
  ```
37
 
38
  This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:
39
 
40
  ## Example Code
41
 
42
- Running this code requires under 5GB of GPU VRAM.
43
 
44
  ```python
45
  from transformers import AutoModelForCausalLM, AutoTokenizer
@@ -50,7 +50,7 @@ model = AutoModelForCausalLM.from_pretrained("dicta-il/dictalm2.0-instruct-GPTQ"
50
  tokenizer = AutoTokenizer.from_pretrained("dicta-il/dictalm2.0-instruct-GPTQ")
51
 
52
  messages = [
53
- {"role": "user", "content": "ืžื” ื”ืจื•ื˜ื‘ ืื”ื•ื‘ ืขืœื™ืš?"},
54
  {"role": "assistant", "content": "ื˜ื•ื‘, ืื ื™ ื“ื™ ืžื—ื‘ื‘ ื›ืžื” ื˜ื™ืคื•ืช ืžื™ืฅ ืœื™ืžื•ืŸ ืกื—ื•ื˜ ื˜ืจื™. ื–ื” ืžื•ืกื™ืฃ ื‘ื“ื™ื•ืง ืืช ื”ื›ืžื•ืช ื”ื ื›ื•ื ื” ืฉืœ ื˜ืขื ื—ืžืฆืžืฅ ืœื›ืœ ืžื” ืฉืื ื™ ืžื‘ืฉืœ ื‘ืžื˜ื‘ื—!"},
55
  {"role": "user", "content": "ื”ืื ื™ืฉ ืœืš ืžืชื›ื•ื ื™ื ืœืžื™ื•ื ื–?"}
56
  ]
@@ -60,7 +60,7 @@ encoded = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device
60
  generated_ids = model.generate(encoded, max_new_tokens=50, do_sample=True)
61
  decoded = tokenizer.batch_decode(generated_ids)
62
  print(decoded[0])
63
- # <s> [INST] ืžื” ื”ืจื•ื˜ื‘ ืื”ื•ื‘ ืขืœื™ืš? [/INST]
64
  # ื˜ื•ื‘, ืื ื™ ื“ื™ ืžื—ื‘ื‘ ื›ืžื” ื˜ื™ืคื•ืช ืžื™ืฅ ืœื™ืžื•ืŸ ืกื—ื•ื˜ ื˜ืจื™. ื–ื” ืžื•ืกื™ืฃ ื‘ื“ื™ื•ืง ืืช ื”ื›ืžื•ืช ื”ื ื›ื•ื ื” ืฉืœ ื˜ืขื ื—ืžืฆืžืฅ ืœื›ืœ ืžื” ืฉืื ื™ ืžื‘ืฉืœ ื‘ืžื˜ื‘ื—!</s> [INST] ื”ืื ื™ืฉ ืœืš ืžืชื›ื•ื ื™ื ืœืžื™ื•ื ื–? [/INST]
65
  # ื‘ื˜ื—, ื”ื ื” ืžืชื›ื•ืŸ ืงืœ ืžืื•ื“ ืœืžื™ื•ื ื– ื‘ื™ืชื™:
66
  #
 
31
 
32
  E.g.
33
  ```
34
+ text = """<s>[INST] ืื™ื–ื” ืจื•ื˜ื‘ ืื”ื•ื‘ ืขืœื™ืš? [/INST]
35
+ ื˜ื•ื‘, ืื ื™ ื“ื™ ืžื—ื‘ื‘ ื›ืžื” ื˜ื™ืคื•ืช ืžื™ืฅ ืœื™ืžื•ืŸ ืกื—ื•ื˜ ื˜ืจื™. ื–ื” ืžื•ืกื™ืฃ ื‘ื“ื™ื•ืง ืืช ื”ื›ืžื•ืช ื”ื ื›ื•ื ื” ืฉืœ ื˜ืขื ื—ืžืฆืžืฅ ืœื›ืœ ืžื” ืฉืื ื™ ืžื‘ืฉืœ ื‘ืžื˜ื‘ื—!</s>[INST] ื”ืื ื™ืฉ ืœืš ืžืชื›ื•ื ื™ื ืœืžื™ื•ื ื–? [/INST]"
36
  ```
37
 
38
  This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:
39
 
40
  ## Example Code
41
 
42
+ Running this code requires less than 5GB of GPU VRAM.
43
 
44
  ```python
45
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
50
  tokenizer = AutoTokenizer.from_pretrained("dicta-il/dictalm2.0-instruct-GPTQ")
51
 
52
  messages = [
53
+ {"role": "user", "content": "ืื™ื–ื” ืจื•ื˜ื‘ ืื”ื•ื‘ ืขืœื™ืš?"},
54
  {"role": "assistant", "content": "ื˜ื•ื‘, ืื ื™ ื“ื™ ืžื—ื‘ื‘ ื›ืžื” ื˜ื™ืคื•ืช ืžื™ืฅ ืœื™ืžื•ืŸ ืกื—ื•ื˜ ื˜ืจื™. ื–ื” ืžื•ืกื™ืฃ ื‘ื“ื™ื•ืง ืืช ื”ื›ืžื•ืช ื”ื ื›ื•ื ื” ืฉืœ ื˜ืขื ื—ืžืฆืžืฅ ืœื›ืœ ืžื” ืฉืื ื™ ืžื‘ืฉืœ ื‘ืžื˜ื‘ื—!"},
55
  {"role": "user", "content": "ื”ืื ื™ืฉ ืœืš ืžืชื›ื•ื ื™ื ืœืžื™ื•ื ื–?"}
56
  ]
 
60
  generated_ids = model.generate(encoded, max_new_tokens=50, do_sample=True)
61
  decoded = tokenizer.batch_decode(generated_ids)
62
  print(decoded[0])
63
+ # <s> [INST] ืื™ื–ื” ืจื•ื˜ื‘ ืื”ื•ื‘ ืขืœื™ืš? [/INST]
64
  # ื˜ื•ื‘, ืื ื™ ื“ื™ ืžื—ื‘ื‘ ื›ืžื” ื˜ื™ืคื•ืช ืžื™ืฅ ืœื™ืžื•ืŸ ืกื—ื•ื˜ ื˜ืจื™. ื–ื” ืžื•ืกื™ืฃ ื‘ื“ื™ื•ืง ืืช ื”ื›ืžื•ืช ื”ื ื›ื•ื ื” ืฉืœ ื˜ืขื ื—ืžืฆืžืฅ ืœื›ืœ ืžื” ืฉืื ื™ ืžื‘ืฉืœ ื‘ืžื˜ื‘ื—!</s> [INST] ื”ืื ื™ืฉ ืœืš ืžืชื›ื•ื ื™ื ืœืžื™ื•ื ื–? [/INST]
65
  # ื‘ื˜ื—, ื”ื ื” ืžืชื›ื•ืŸ ืงืœ ืžืื•ื“ ืœืžื™ื•ื ื– ื‘ื™ืชื™:
66
  #