mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #155] Encode crash #83
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @narrowengineer on GitHub (Sep 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/155
Exception occurred during processing of request from ('192.168.1.125', 55711)
Traceback (most recent call last):
File "C:\Users\steve\AppData\Local\Programs\Python\Python312\Lib\socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "C:\Users\steve\AppData\Local\Programs\Python\Python312\Lib\socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\steve\AppData\Local\Programs\Python\Python312\Lib\socketserver.py", line 766, in init
self.handle()
File "C:\Users\steve\AppData\Local\Programs\Python\Python312\Lib\http\server.py", line 436, in handle
self.handle_one_request()
File "C:\Users\steve\AppData\Local\Programs\Python\Python312\Lib\http\server.py", line 424, in handle_one_request
method()
File "C:\ai_server\Strata-main\serve\server.py", line 1188, in do_POST
self._openai(req)
File "C:\ai_server\Strata-main\serve\server.py", line 1244, in _openai
ids, thinking, max_new = svc.prepare(messages, tools, kw, max_new)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai_server\Strata-main\serve\server.py", line 620, in prepare
ids = self.tok.encode(prompt, parse_special=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai_server\Strata-main\tools\strata_tokenizer.py", line 195, in encode
return self._encode_matching(text, self._special_re if parse_special else self._always_re)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai_server\Strata-main\tools\strata_tokenizer.py", line 182, in _encode_matching
out.extend(self._encode_plain(text[pos:m.start()]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ai_server\Strata-main\tools\strata_tokenizer.py", line 161, in _encode_plain
mapped = "".join(BYTE_TO_UNICODE[b] for b in piece.encode("utf-8"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'bytes' object is not callable
@Niko1221 commented on GitHub (Sep 29, 2026):
Thanks for the trace. That line (
piece.encode("utf-8")) can't raise this error for ordinary text, and together with #147 it looks like the Python process itself is getting corrupted. Please update to 0.1.26, reinstall the packages (pip install --force-reinstall regex numpyin Strata's venv), and reopen with the request that triggers it if it happens again.