Skip to content

Commit a09439d

Browse files
committed
update prompt to tell it input is a single sentence
1 parent e1de666 commit a09439d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

neuro/agent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def wrapper(*args, **kwargs):
3030

3131
def brainstorm_init_questions(lm, args) -> List[str]:
3232
PROMPT = f"""
33-
You are a scientific agent tasked with generating useful questions for linearly predicting fMRI responses to natural language stimuli.
33+
You are a scientific agent tasked with generating useful questions for linearly predicting fMRI responses to natural language sentences.
3434
{f'Specifically, you are predicting fMRI responses to the {args.predict_subset} cortex.' if not args.predict_subset == 'all' else ''}
3535
3636
Brainstorm some questions that could be useful.
@@ -40,6 +40,7 @@ def brainstorm_init_questions(lm, args) -> List[str]:
4040
Each question should not contain many examples.
4141
Each question should ask about one concept rather than joining together unrelated concepts.
4242
Each question must start with "Does the input" and end with "?".
43+
The input to each question will be a single sentence from a narrative story.
4344
Example: ["Does the input mention a location?", "Does the input mention time?", "Does the input contain a proper noun?"]
4445
""".strip()
4546
questions_list_str = lm(PROMPT, max_completion_tokens=None, temperature=0, seed=args.seed, reasoning_effort='high')
@@ -74,7 +75,7 @@ def update_questions(lm, args, questions_list: List[str], r) -> List[str]:
7475

7576
PROMPT = f"""
7677
# Main instructions
77-
You are a scientific agent tasked with generating useful questions for linearly predicting fMRI responses to natural language stimuli.
78+
You are a scientific agent tasked with generating useful questions for linearly predicting fMRI responses to natural language sentences.
7879
{f'Specifically, you are predicting fMRI responses to the {args.predict_subset} cortex.' if not args.predict_subset == 'all' else ''}
7980
8081
Here is the original list of questions that have been previously tested, along with their feature importance (higher is more important):
@@ -107,6 +108,7 @@ def update_questions(lm, args, questions_list: List[str], r) -> List[str]:
107108
Each question should not contain many examples.
108109
Each question should ask about one concept rather than joining together unrelated concepts.
109110
Each question must start with "Does the input" and end with "?". It is very important that every question starts with "Does the input".
111+
The input to each question will be a single sentence from a narrative story.
110112
Example output: ["Does the input mention a location?", "Does the input mention time?", "Does the input contain a proper noun?"]
111113
""".strip()
112114
questions_list_str = lm(PROMPT, temperature=0, max_completion_tokens=None, seed=args.seed, reasoning_effort='high')

scripts/10_sub_agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# 'subject': ['UTS02'],
2121
'seed': [1],
2222
'subject': [f'UTS0{k}' for k in range(1, 4)],
23-
'save_dir': ['/home/chansingh/mntv1/deep-fMRI/encoding/aug19_agentic'],
23+
'save_dir': ['/home/chansingh/mntv1/deep-fMRI/encoding/aug26_agentic'],
2424
# 'predict_subset': ['prefrontal', 'occipital', 'sensorimotor', 'cingulate', 'insula', 'parietal', 'temporal'],
2525
'predict_subset': ['all'], #, 'prefrontal'],
2626

@@ -63,13 +63,13 @@
6363
}
6464

6565
submit_utils.run_args_list(
66-
args_list[::-1],
66+
args_list,
6767
script_name=script_name,
6868
unique_seeds='seed_stories',
69-
# amlt_kwargs=amlt_kwargs,
69+
amlt_kwargs=amlt_kwargs,
7070
# n_cpus=8,
7171
# actually_run=False,
72-
gpu_ids=[0, 1, 2, 3],
72+
# gpu_ids=[0, 1, 2, 3],
7373
repeat_failed_jobs=True,
7474
# shuffle=True,
7575
cmd_python=f'export HF_TOKEN={open(expanduser("~/.HF_TOKEN"), "r").read().strip()}; .venv/bin/python',

0 commit comments

Comments
 (0)