메인 콘텐츠로 건너뛰기
GitHub 소스

class Html

W&B에서 HTML 콘텐츠를 로깅하는 데 사용하는 클래스입니다.

메서드 Html.__init__

__init__(
    data: 'str | pathlib.Path | TextIO',
    inject: 'bool' = True,
    data_is_not_path: 'bool' = False
) → None
W&B HTML 객체를 생성합니다. Args: data: 확장자가 “.html”인 파일 경로 문자열이거나, 리터럴 HTML을 포함하는 문자열 또는 IO 객체입니다.
  • inject: HTML 객체에 스타일시트를 추가합니다. False로 설정하면 HTML은 변경되지 않고 그대로 전달됩니다.
  • data_is_not_path: False로 설정하면 data를 파일 경로로 간주합니다.
Examples: 파일 경로를 제공하여 초기화할 수 있습니다:
with wandb.init() as run:
    run.log({"html": wandb.Html("./index.html")})
또는 문자열 또는 IO 객체에 담긴 리터럴 HTML을 전달하여 초기화할 수도 있습니다:
with wandb.init() as run:
    run.log({"html": wandb.Html("<h1>Hello, world!</h1>")})