메인 콘텐츠로 건너뛰기

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 객체를 생성합니다. 매개변수: data: 확장자가 “.html”인 파일 경로를 나타내는 문자열이거나, 리터럴 HTML이 들어 있는 문자열 또는 IO 객체입니다.
  • inject: HTML 객체에 스타일시트를 추가합니다. False로 설정하면 HTML이 변경 없이 그대로 전달됩니다.
  • data_is_not_path: False로 설정하면 data를 파일 경로로 처리합니다.
예제: 파일 경로를 지정해 초기화할 수 있습니다:
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>")})