neoz commited on
Commit
e618f3a
1 Parent(s): fc345c8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -3
README.md CHANGED
@@ -39,14 +39,13 @@ model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, d
39
  messages = [
40
  {"role": "user", "content": "推荐5个北京的景点。"},
41
  ]
42
- model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device)
43
 
44
  model_outputs = model.generate(
45
  model_inputs,
46
  max_new_tokens=1024,
47
  top_p=0.7,
48
- temperature=0.7,
49
- repetition_penalty=1.02
50
  )
51
 
52
  output_token_ids = [
 
39
  messages = [
40
  {"role": "user", "content": "推荐5个北京的景点。"},
41
  ]
42
+ model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(device)
43
 
44
  model_outputs = model.generate(
45
  model_inputs,
46
  max_new_tokens=1024,
47
  top_p=0.7,
48
+ temperature=0.7
 
49
  )
50
 
51
  output_token_ids = [