Simon Strandgaard
commited on
Commit
·
3d88dc7
1
Parent(s):
e49f146
Moved hardcoded text to constant
Browse files
src/plan/app_text2plan.py
CHANGED
|
@@ -56,6 +56,8 @@ RELAY_PROCESS_OUTPUT = False
|
|
| 56 |
# Global constant for the zip creation interval (in seconds)
|
| 57 |
ZIP_INTERVAL_SECONDS = 10
|
| 58 |
|
|
|
|
|
|
|
| 59 |
# Load prompt catalog and examples.
|
| 60 |
prompt_catalog = PromptCatalog()
|
| 61 |
prompt_catalog.load(os.path.join(os.path.dirname(__file__), 'data', 'simple_plan_prompts.jsonl'))
|
|
@@ -164,7 +166,7 @@ def run_planner(submit_or_retry_button, plan_prompt, session_state: SessionState
|
|
| 164 |
if not session_state.latest_run_id:
|
| 165 |
raise ValueError("No previous run to retry. Please submit a plan first.")
|
| 166 |
run_id = session_state.latest_run_id
|
| 167 |
-
run_path = os.path.join(
|
| 168 |
absolute_path_to_run_dir = session_state.latest_run_dir
|
| 169 |
print(f"Retrying the run with ID: {run_id}")
|
| 170 |
if not os.path.exists(run_path):
|
|
@@ -172,7 +174,7 @@ def run_planner(submit_or_retry_button, plan_prompt, session_state: SessionState
|
|
| 172 |
|
| 173 |
elif submit_or_retry == "submit":
|
| 174 |
run_id = generate_run_id(CONFIG.use_uuid_as_run_id)
|
| 175 |
-
run_path = os.path.join(
|
| 176 |
absolute_path_to_run_dir = os.path.abspath(run_path)
|
| 177 |
|
| 178 |
print(f"Submitting a new run with ID: {run_id}")
|
|
|
|
| 56 |
# Global constant for the zip creation interval (in seconds)
|
| 57 |
ZIP_INTERVAL_SECONDS = 10
|
| 58 |
|
| 59 |
+
RUN_DIR = "run"
|
| 60 |
+
|
| 61 |
# Load prompt catalog and examples.
|
| 62 |
prompt_catalog = PromptCatalog()
|
| 63 |
prompt_catalog.load(os.path.join(os.path.dirname(__file__), 'data', 'simple_plan_prompts.jsonl'))
|
|
|
|
| 166 |
if not session_state.latest_run_id:
|
| 167 |
raise ValueError("No previous run to retry. Please submit a plan first.")
|
| 168 |
run_id = session_state.latest_run_id
|
| 169 |
+
run_path = os.path.join(RUN_DIR, run_id)
|
| 170 |
absolute_path_to_run_dir = session_state.latest_run_dir
|
| 171 |
print(f"Retrying the run with ID: {run_id}")
|
| 172 |
if not os.path.exists(run_path):
|
|
|
|
| 174 |
|
| 175 |
elif submit_or_retry == "submit":
|
| 176 |
run_id = generate_run_id(CONFIG.use_uuid_as_run_id)
|
| 177 |
+
run_path = os.path.join(RUN_DIR, run_id)
|
| 178 |
absolute_path_to_run_dir = os.path.abspath(run_path)
|
| 179 |
|
| 180 |
print(f"Submitting a new run with ID: {run_id}")
|