Skip to content
Merged
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
10 changes: 8 additions & 2 deletions swanlab/api/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from swanlab.api.base import ApiBase, ApiHTTP
from swanlab.api.types import ApiResponse, Experiment, Pagination
from swanlab.package import get_host_api

try:
from pandas import DataFrame
Expand Down Expand Up @@ -161,7 +162,7 @@ def get_metrics(
Args:
exp_id (str): 实验CUID
keys (list[str]): 指标key列表

Returns:
ApiResponse[DataFrame]:
"""
Expand All @@ -179,7 +180,12 @@ def get_metrics(
if resp.errmsg:
continue

url = resp.data.get("url", "")
url:str = resp.data.get("url", "")
# 私有化环境可能不会携带 ip:https://github.com/SwanHubX/SwanLab/issues/1267
if not (url.startswith('https://') or url.startswith('http://')):
url = get_host_api() + url # url 已添加前缀 /


df = pd.read_csv(url, index_col=0)

if idx == 0:
Expand Down