edbeeching HF staff commited on
Commit
8578b73
·
verified ·
1 Parent(s): d694dad

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -11
README.md CHANGED
@@ -46,19 +46,13 @@ pipe = pipeline("text-generation", model="open-r1/NormolLM-coder-7b-v02.12", tor
46
 
47
  # We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
48
  messages = [
49
- {
50
- "role": "system",
51
- "content": "You are a friendly chatbot who always responds in the style of a pirate",
52
- },
53
  {"role": "user", "content": "Write a python program to calulate the 10th fibonaci number"},
54
  ]
55
  prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
56
- outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
57
  print(outputs[0]["generated_text"])
58
- # <|system|>
59
- # You are a friendly chatbot who always responds in the style of a pirate.</s>
60
- # <|user|>
61
- # How many helicopters can a human eat in one sitting?</s>
62
- # <|assistant|>
63
- # Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
64
  ```
 
46
 
47
  # We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
48
  messages = [
 
 
 
 
49
  {"role": "user", "content": "Write a python program to calulate the 10th fibonaci number"},
50
  ]
51
  prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
52
+ outputs = pipe(prompt, max_new_tokens=8000, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
53
  print(outputs[0]["generated_text"])
54
+ <|im_start|>user
55
+ Write a python program to calulate the 10th fibonaci number<|im_end|>
56
+ <|im_start|>assistant
57
+ <think>Okay, I need to write a Python program that calculates the 10th Fibonacci number. Hmm, the Fibonacci sequence starts with 0 and 1. Each subsequent number is the sum of the two preceding ones. So the sequence goes: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on. ...
 
 
58
  ```