Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/agentlab/analyze/agent_xray.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,10 @@ def run_gradio(results_dir: Path):
demo.queue()

do_share = os.getenv("AGENTXRAY_SHARE_GRADIO", "false").lower() == "true"
demo.launch(server_port=int(os.getenv("AGENTXRAY_APP_PORT", "7899")), share=do_share)
port = os.getenv("AGENTXRAY_APP_PORT", None)
if isinstance(port, str):
port = int(port)
demo.launch(server_port=port, share=do_share)


def tab_select(evt: gr.SelectData):
Expand Down
22 changes: 20 additions & 2 deletions src/agentlab/experiments/reproducibility_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from git.config import GitConfigParser

import agentlab
from agentlab.experiments.exp_utils import RESULTS_DIR


def _get_repo(module):
Expand Down Expand Up @@ -193,8 +194,13 @@ def get_reproducibility_info(
if isinstance(agent_names, str):
agent_names = [agent_names]

try:
repo = _get_repo(agentlab)
except InvalidGitRepositoryError:
repo = None

info = {
"git_user": _get_git_username(_get_repo(agentlab)),
"git_user": _get_git_username(repo),
"agent_names": agent_names,
"benchmark": benchmark.name,
"study_id": study_id,
Expand Down Expand Up @@ -313,7 +319,19 @@ def append_to_journal(
):
"""Append the info and results to the reproducibility journal."""
if journal_path is None:
journal_path = Path(agentlab.__file__).parent.parent.parent / "reproducibility_journal.csv"
try:
_get_repo(agentlab) # if not based on git clone, this will raise an error
journal_path = (
Path(agentlab.__file__).parent.parent.parent / "reproducibility_journal.csv"
)
except InvalidGitRepositoryError:
logging.warning(
"Could not find a git repository. Saving the journal to the results directory."
"To add to the journal, git clone agentlab and use `pip install -e .`"
)
journal_path = RESULTS_DIR / "reproducibility_journal.csv"

logging.info(f"Appending to journal {journal_path}")

if len(report_df) != len(info["agent_names"]):
raise ValueError(
Expand Down