Skip to content

Commit

Permalink
feat: allow overwriting solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
phanhongan committed Nov 16, 2024
1 parent fa15a8d commit 4e243ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/llamarine/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ DEFAULT_API_KEY=
DEFAULT_API_BASE=
USE_DOMAIN_LM=False
OUTPUT_DIR=output
OVERWRITE=False
3 changes: 2 additions & 1 deletion examples/llamarine/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from openssa import OpenAILM

USE_DOMAIN_LM = os.environ.get('USE_DOMAIN_LM', 'False').lower() == 'true'
OVERWRITE = os.environ.get('OVERWRITE', 'False').lower() == 'true'

TITLE: str = 'OpenSSA: Maritime-Specific Agent'

Expand Down Expand Up @@ -66,7 +67,7 @@ def main(use_domain_lm: bool = False):
)

if 'agent_solutions' not in st.session_state:
if os.path.exists(OUTPUT_FILE_PATH):
if os.path.exists(OUTPUT_FILE_PATH) and not OVERWRITE:
with open(file=OUTPUT_FILE_PATH, encoding='utf-8') as f:
st.session_state.agent_solutions: defaultdict[str, str] = defaultdict(str, json.loads(f.read()))
else:
Expand Down

0 comments on commit 4e243ea

Please sign in to comment.