plasmova commited on
Commit
7ec0187
·
verified ·
1 Parent(s): f3ea023

Recommend stable temperature 0.2 decoding settings

Browse files
Files changed (1) hide show
  1. README.md +7 -2
README.md CHANGED
@@ -51,6 +51,11 @@ inputs = tokenizer(prompt, return_tensors="pt")
51
  output = model.generate(
52
  **inputs,
53
  max_new_tokens=128,
 
 
 
 
 
54
  eos_token_id=[
55
  tokenizer.eos_token_id,
56
  tokenizer.convert_tokens_to_ids("<|/assistant|>"),
@@ -59,7 +64,7 @@ output = model.generate(
59
  print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
60
  ```
61
 
62
- The system prompt is optional. The example runs on CPU; for GPU inference, move the model and inputs to a supported device and dtype. Keep the total prompt and generated text within the 2,048-token context limit.
63
 
64
  ## Evaluation
65
 
@@ -83,4 +88,4 @@ On a separate 100-question GSM8K sample with five examples in context, Nova v3 a
83
 
84
  The v3 training code specifies pretraining on a mixture of FineWeb-Edu, DCLM, Cosmopedia-v2, FineMath, Wikipedia, and CodeParrot, followed by SmolTalk fine-tuning. Dataset contents remain subject to their respective upstream terms.
85
 
86
- The model weights and accompanying custom model code are released under the Apache License 2.0. See [LICENSE](LICENSE).
 
51
  output = model.generate(
52
  **inputs,
53
  max_new_tokens=128,
54
+ do_sample=True,
55
+ temperature=0.2,
56
+ top_p=0.9,
57
+ top_k=40,
58
+ repetition_penalty=1.08,
59
  eos_token_id=[
60
  tokenizer.eos_token_id,
61
  tokenizer.convert_tokens_to_ids("<|/assistant|>"),
 
64
  print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
65
  ```
66
 
67
+ Recommended starting settings are temperature **0.2**, top-p **0.9**, top-k **40**, and repetition penalty **1.08**. These focused settings are a starting point; adjust them for your task. The system prompt is optional. Keep the total prompt and generated text within the 2,048-token context. The example runs on CPU; for GPU inference, move the model and inputs to a supported device and dtype.
68
 
69
  ## Evaluation
70
 
 
88
 
89
  The v3 training code specifies pretraining on a mixture of FineWeb-Edu, DCLM, Cosmopedia-v2, FineMath, Wikipedia, and CodeParrot, followed by SmolTalk fine-tuning. Dataset contents remain subject to their respective upstream terms.
90
 
91
+ The model weights and accompanying custom model code are released under the Apache License 2.0. See [LICENSE](LICENSE).