File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -501,7 +501,10 @@ def run_gradio(results_dir: Path):
501501 demo .queue ()
502502
503503 do_share = os .getenv ("AGENTXRAY_SHARE_GRADIO" , "false" ).lower () == "true"
504- demo .launch (server_port = int (os .getenv ("AGENTXRAY_APP_PORT" , "7899" )), share = do_share )
504+ port = os .getenv ("AGENTXRAY_APP_PORT" , None )
505+ if isinstance (port , str ):
506+ port = int (port )
507+ demo .launch (server_port = port , share = do_share )
505508
506509
507510def tab_select (evt : gr .SelectData ):
Original file line number Diff line number Diff line change 1212from git .config import GitConfigParser
1313
1414import agentlab
15+ from agentlab .experiments .exp_utils import RESULTS_DIR
1516
1617
1718def _get_repo (module ):
@@ -193,8 +194,13 @@ def get_reproducibility_info(
193194 if isinstance (agent_names , str ):
194195 agent_names = [agent_names ]
195196
197+ try :
198+ repo = _get_repo (agentlab )
199+ except InvalidGitRepositoryError :
200+ repo = None
201+
196202 info = {
197- "git_user" : _get_git_username (_get_repo ( agentlab ) ),
203+ "git_user" : _get_git_username (repo ),
198204 "agent_names" : agent_names ,
199205 "benchmark" : benchmark .name ,
200206 "study_id" : study_id ,
@@ -313,7 +319,13 @@ def append_to_journal(
313319):
314320 """Append the info and results to the reproducibility journal."""
315321 if journal_path is None :
316- journal_path = Path (agentlab .__file__ ).parent .parent .parent / "reproducibility_journal.csv"
322+ try :
323+ _get_repo (agentlab ) # if not based on git clone, this will raise an error
324+ journal_path = Path (agentlab .__file__ ).parent .parent .parent / "reproducibility_journal.csv"
325+ except InvalidGitRepositoryError :
326+ journal_path = RESULTS_DIR / "reproducibility_journal.csv"
327+
328+ logging .info (f"Appending to journal { journal_path } " )
317329
318330 if len (report_df ) != len (info ["agent_names" ]):
319331 raise ValueError (
You can’t perform that action at this time.
0 commit comments