Skip to content

Commit 6ffa7e3

Browse files
Scenario Demo
1 parent 05b7007 commit 6ffa7e3

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ There are three main ways to use PromptWizard:
7676
- Scenario 2 : Generating synthetic examples and using them to optimize prompts
7777
- Scenario 3 : Optimizing prompts with training data
7878
79-
**NOTE** : Refer this [notebook](demos/scenarios/dataset_scenarios_demo.ipynb) to get a detailed understanding of the usage for each of the scenarios. **This servers as a starting point to understand the usage of PromptWizard**
79+
**NOTE** : Refer this [notebook](demos/scenarios/dataset_scenarios_demo.ipynb) to get a detailed understanding of the usage for each of the scenarios. **This serves as a starting point to understand the usage of PromptWizard**
8080
8181
#### High level overview of using PromptWizard
8282
- Decide your scenario

demos/scenarios/dataset_scenarios_demo.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"config_dict = {\n",
126126
" \"task_description\": \"You are a mathematics expert. You will be given a mathematics problem which you need to solve\",\n",
127127
" \"base_instruction\": \"Lets think step by step.\",\n",
128-
" \"mutation_rounds\": 2\n",
128+
" \"mutation_rounds\": 5\n",
129129
" }\n",
130130
"update_yaml_file(file_path,config_dict)"
131131
]
@@ -274,7 +274,8 @@
274274
"id": "96d07ae3",
275275
"metadata": {},
276276
"source": [
277-
"Set the configurations to first generate synthetic training data"
277+
"Set the configurations to first generate synthetic training data. \\\n",
278+
"Any number of synthetic examples can be generated and then used for optimizing prompts as mentioned in STEP 2"
278279
]
279280
},
280281
{
@@ -287,7 +288,7 @@
287288
"file_path = 'configs/promptopt_config.yaml' \n",
288289
"# Set the number of synthetic training examples to be generated\n",
289290
"config_dict = {\n",
290-
" \"num_train_examples\":40\n",
291+
" \"num_train_examples\":20\n",
291292
" }\n",
292293
"update_yaml_file(file_path,config_dict)"
293294
]

promptwizard/glue/promptopt/techniques/critique_n_refine/core_logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,14 @@ def get_best_prompt(self, params: PromptOptimizationParams,use_examples=False,ru
469469
f"current_base_instruction: {current_base_instruction}")
470470
candidate_prompts = self.gen_different_styles(current_base_instruction,
471471
params.task_description,
472-
params.mutation_rounds,
472+
params.mutation_rounds+1,
473473
params.style_variation)
474474

475475
if run_without_train_examples:
476476
prompt_index = 1
477477
print("\nOptimization Finished...")
478478
print("\nPossible prompt variations:")
479-
for candidate in candidate_prompts[:5]:
479+
for candidate in candidate_prompts[:params.mutation_rounds]:
480480
final_best_prompt = self.prompt_pool.final_prompt.format(
481481
instruction=candidate,
482482
answer_format=params.answer_format,

0 commit comments

Comments
 (0)