Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorboard closes unclosed HTML tags in text log #6979

Open
Kanaricc opened this issue Feb 27, 2025 · 2 comments
Open

Tensorboard closes unclosed HTML tags in text log #6979

Kanaricc opened this issue Feb 27, 2025 · 2 comments

Comments

@Kanaricc
Copy link

Environment information

--- check: autoidentify
INFO: diagnose_tensorboard.py version c6ca9f1d004e2a1bc7c160abc43be229b82cad7e

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=11, micro=11, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: False
INFO: $VIRTUAL_ENV: '/Users/[DELETED]/projects/test-tensorboard/.venv'

--- check: installed_packages
Traceback (most recent call last):
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 511, in main
    suggestions.extend(check())
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 185, in installed_packages
    freeze = pip(["freeze", "--all"]).decode("utf-8").splitlines()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 109, in pip
    return subprocess.check_output(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[DELETED]/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[DELETED]/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/Users/[DELETED]/projects/test-tensorboard/.venv/bin/python', '-m', 'pip', '--disable-pip-version-check', 'freeze', '--all']' returned non-zero exit status 1.

--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '2.19.0'

--- check: tensorflow_python_version
Traceback (most recent call last):
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 511, in main
    suggestions.extend(check())
                       ^^^^^^^
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 81, in wrapper
    result = fn()
             ^^^^
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 267, in tensorflow_python_version
    import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

--- check: tensorboard_data_server_version
INFO: data server binary: None

--- check: tensorboard_binary_path
INFO: which tensorboard: b'/Users/[DELETED]/projects/test-tensorboard/.venv/bin/tensorboard\n'

--- check: addrinfos
socket.has_ipv6 = True
socket.AF_UNSPEC = <AddressFamily.AF_UNSPEC: 0>
socket.SOCK_STREAM = <SocketKind.SOCK_STREAM: 1>
socket.AI_ADDRCONFIG = <AddressInfo.AI_ADDRCONFIG: 1024>
socket.AI_PASSIVE = <AddressInfo.AI_PASSIVE: 1>
Loopback flags: <AddressInfo.AI_ADDRCONFIG: 1024>
Loopback infos: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 0)), (<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 0, 0, 0))]
Wildcard flags: <AddressInfo.AI_PASSIVE: 1>
Wildcard infos: [(<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('0.0.0.0', 0))]

--- check: readable_fqdn
INFO: socket.getfqdn(): '1.0.0.127.in-addr.arpa'

--- check: stat_tensorboardinfo
INFO: directory: /var/folders/00/h7yr1br9729g8rs335w9yjk00000gp/T/.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=10273270, st_dev=16777234, st_nlink=2, st_uid=502, st_gid=20, st_size=64, st_atime=1740626089, st_mtime=1740627747, st_ctime=1740627747)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['/Users/[DELETED]/projects/test-tensorboard/.venv/lib/python3.11/site-packages']; bad_roots (0): []

--- check: full_pip_freeze
Traceback (most recent call last):
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 511, in main
    suggestions.extend(check())
                       ^^^^^^^
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 81, in wrapper
    result = fn()
             ^^^^
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 478, in full_pip_freeze
    "pip freeze --all:\n%s", pip(["freeze", "--all"]).decode("utf-8")
                             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[DELETED]/projects/test-tensorboard/dt.py", line 109, in pip
    return subprocess.check_output(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[DELETED]/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/[DELETED]/.local/share/uv/python/cpython-3.11.11-macos-aarch64-none/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/Users/[DELETED]/projects/test-tensorboard/.venv/bin/python', '-m', 'pip', '--disable-pip-version-check', 'freeze', '--all']' returned non-zero exit status 1.

Issue description

text log unexpectedly closes unclosed tags, for example hello!<think> becomes hello!<think></think>.

Steps to reproduce:

from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter(log_dir='logs')
writer.add_text("test", "Hello from test-tensorboard!<think>")
writer.close()
Image
@rileyajones
Copy link
Contributor

I believe this is happening as a result of the HTML sanitizer. So that I understand the usecase, is there a reason that you need to write unclosed html tags?

@Kanaricc
Copy link
Author

Thanks @rileyajones . In recent reinforcement fine-tuning approaches, the input prompts to the model may end with unclosed tags to trigger chain-of-thought reasoning (such as orz), where the tag is supposed to be closed by the models' outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants