Skip to content

Commit cb283fd

Browse files
committed
feat: customize instruction and response
1 parent 1e24364 commit cb283fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bigcodebench/generate.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def run_codegen(
139139
backend: str = "vllm",
140140
base_url: str = None,
141141
tp: int = 1,
142+
instruction_prefix: str = None,
143+
response_prefix: str = None,
142144
revision: str = "main",
143145
trust_remote_code: bool = False,
144146
tokenizer_name: str = None,
@@ -160,8 +162,10 @@ def run_codegen(
160162
# Make project dir
161163
os.makedirs(root, exist_ok=True)
162164

163-
instruction_prefix = "Please provide a self-contained Python script that solves the following problem in a markdown code block:"
164-
response_prefix = "Below is a Python script with a self-contained function that solves the problem and passes corresponding tests:"
165+
if instruction_prefix is None:
166+
instruction_prefix = "Please provide a self-contained Python script that solves the following problem in a markdown code block:"
167+
if response_prefix is None:
168+
response_prefix = "Below is a Python script with a self-contained function that solves the problem and passes corresponding tests:"
165169

166170
# Make dir for codes generated by each model
167171
model_runner = make_model(

0 commit comments

Comments
 (0)