manueldeprada HF Staff commited on
Commit
97c3e33
·
1 Parent(s): 47784f5
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -48,19 +48,19 @@ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct", devic
48
  inputs = tokenizer(["The quick brown"], return_tensors="pt").to(model.device)
49
 
50
  # Basic sampling
51
- gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache", trust_remote_code=True)
52
 
53
  # With temperature
54
- gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache", temperature=0.8, trust_remote_code=True)
55
 
56
  # With top-k
57
- gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache", top_k=50, trust_remote_code=True)
58
 
59
  # With top-p (nucleus sampling)
60
- gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache", top_p=0.9, trust_remote_code=True)
61
 
62
  # Greedy decoding (no sampling)
63
- gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache", do_sample=False, trust_remote_code=True)
64
 
65
  # Get detailed output with probabilities
66
  gen_out = model.generate(
 
48
  inputs = tokenizer(["The quick brown"], return_tensors="pt").to(model.device)
49
 
50
  # Basic sampling
51
+ gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache_hf_helpers", trust_remote_code=True)
52
 
53
  # With temperature
54
+ gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache_hf_helpers", temperature=0.8, trust_remote_code=True)
55
 
56
  # With top-k
57
+ gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache_hf_helpers", top_k=50, trust_remote_code=True)
58
 
59
  # With top-p (nucleus sampling)
60
+ gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache_hf_helpers", top_p=0.9, trust_remote_code=True)
61
 
62
  # Greedy decoding (no sampling)
63
+ gen_out = model.generate(**inputs, custom_generate="manueldeprada/sampling_with_kvcache_hf_helpers", do_sample=False, trust_remote_code=True)
64
 
65
  # Get detailed output with probabilities
66
  gen_out = model.generate(