nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/src/exo/master/api.py b/src/exo/master/api.py
2index 30f87e2a..4aac51fe 100644
3--- a/src/exo/master/api.py
4+++ b/src/exo/master/api.py
5@@ -67,7 +67,14 @@ from exo.utils.channels import Receiver, Sender, channel
6 from exo.utils.dashboard_path import find_dashboard
7 from exo.utils.event_buffer import OrderedBuffer
8
9-encoding = load_harmony_encoding(HarmonyEncodingName.HARMONY_GPT_OSS)
10+_encoding: object = None
11+
12+
13+def get_encoding():
14+ global _encoding
15+ if _encoding is None:
16+ _encoding = load_harmony_encoding(HarmonyEncodingName.HARMONY_GPT_OSS)
17+ return _encoding
18
19
20 def chunk_to_response(
21@@ -382,7 +389,7 @@ class API:
22 )
23
24 async def _process_gpt_oss(self, token_chunks: Receiver[TokenChunk]):
25- stream = StreamableParser(encoding, role=Role.ASSISTANT)
26+ stream = StreamableParser(_encoding, role=Role.ASSISTANT)
27 thinking = False
28
29 async for chunk in token_chunks: