From 0c9a44448341a89802f6e44e93044d0b77f178c4 Mon Sep 17 00:00:00 2001 From: BinglanLi Date: Thu, 28 Aug 2025 15:10:13 -0700 Subject: [PATCH 1/2] fix: add tiktoken to main_cascade.py Fix-for: #1 --- main_cascade.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main_cascade.py b/main_cascade.py index f27923b..2ac6daf 100644 --- a/main_cascade.py +++ b/main_cascade.py @@ -13,6 +13,9 @@ from worker import AgentPhD +import tiktoken +MAX_TOKENS = 127900 +encoding = tiktoken.encoding_for_model("gpt-4o") ## baseline system = "You are an efficient and insightful assistant to a molecular biologist." From 0a7fe7f416d657bfc09cce986024f4e9bfd4035e Mon Sep 17 00:00:00 2001 From: BinglanLi Date: Thu, 28 Aug 2025 15:17:28 -0700 Subject: [PATCH 2/2] fix: error caused by invalid output path --- main_cascade.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main_cascade.py b/main_cascade.py index 2ac6daf..457b385 100644 --- a/main_cascade.py +++ b/main_cascade.py @@ -123,6 +123,10 @@ def GeneAgent(ID, genes): pattern = re.compile(r'^[a-zA-Z0-9,.;?!*()_-]+$') ## send genes to GPT-4 and generate the original template of process name and analysis try: + # Ensure output directories exist + os.makedirs("Outputs/GPT-4", exist_ok=True) + os.makedirs("Outputs/GeneAgent/Cascade", exist_ok=True) + os.makedirs("Verification Reports/Cascade", exist_ok=True) prompt_baseline = baseline(genes) first_step = prompt_baseline + system token_baseline = encoding.encode(first_step)