jinliuxi commited on
Commit
028dea3
·
verified ·
1 Parent(s): e1df03f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -0
README.md CHANGED
@@ -19,6 +19,23 @@ in this edition, the output no work well as my wish.
19
 
20
  I will improve it in next time
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  # Uploaded model
23
 
24
  - **Developed by:** jinliuxi
 
19
 
20
  I will improve it in next time
21
 
22
+ '''
23
+ python
24
+ # Generate reasoning
25
+ prompt = "写一首七言绝句"
26
+ reasoning_template = (
27
+ f"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nCutting Knowledge Date: December 2023\nToday Date: 26 July 2024\n\n<|eot_id|>"
28
+ f"<|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|>"
29
+ )
30
+
31
+ # Generate reasoning
32
+ reasoning_inputs = tokenizer(reasoning_template, return_tensors="pt").to(model.device)
33
+ reasoning_ids = model.generate(**reasoning_inputs, max_new_tokens=1024)
34
+ reasoning_output = tokenizer.decode(reasoning_ids[0, reasoning_inputs.input_ids.shape[1]:], skip_special_tokens=True)
35
+
36
+ print("|检验输出|" + reasoning_output)
37
+ '''
38
+
39
  # Uploaded model
40
 
41
  - **Developed by:** jinliuxi