File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
examples/code_generation/codegen Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 3838
3939
4040## 效果展示
41- - 解算法题。求解无重复字符的最长子串的长度
41+
42+ - Github Copilot代码提示效果展示
43+ <p align =" center " >
44+ <img src =" https://user-images.githubusercontent.com/24390500/189046785-6c04a3c3-ce89-4684-9aff-a7dc2e7a7041.gif " /> <br />
45+ </p >
46+
47+ - 解算法题效果展示。求解无重复字符的最长子串的长度
4248``` python
4349from paddlenlp import Taskflow
4450
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class DefaultConfig:
3232 repetition_penalty = 1.0
3333 min_length = 0
3434 max_length = 16
35- decode_strategy = "sampling "
35+ decode_strategy = "greedy_search "
3636 load_state_as_np = True
3737 use_faster = True
3838 use_fp16_decoding = True
@@ -104,9 +104,7 @@ async def gen(item: Input):
104104 logger .info ("Finish generating code" )
105105 end_time = time .time ()
106106 logger .info (f"Time cost: { end_time - start_time } " )
107- output = tokenizer .decode (output [0 ],
108- skip_special_tokens = True ,
109- spaces_between_special_tokens = False )
107+ output = tokenizer .decode (output [0 ], skip_special_tokens = True )
110108 logger .info (f"Generated code: { output } " )
111109 output_json = Output (
112110 id = random_completion_id (),
You can’t perform that action at this time.
0 commit comments