[Frontend] Add routed-experts prompt offset (#51906)

Signed-off-by: aoshen02 <aoshen@inferact.ai>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
aoshen02
2026-08-13 08:09:00 -07:00
committed by GitHub
co-authored by OpenAI Codex mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent f3c1638927
commit 7553aac77b
13 changed files with 114 additions and 61 deletions
+7
View File
@@ -64,6 +64,13 @@ def tensor2base64(x: torch.Tensor) -> str:
return pybase64.b64encode(binary_data).decode("utf-8")
def numpy2base64(array: np.ndarray) -> str:
"""Encode a NumPy array using its `.npy` representation."""
with io.BytesIO() as buffer:
np.save(buffer, array, allow_pickle=False)
return pybase64.b64encode(buffer.getbuffer()).decode("ascii")
def tensor2binary(
tensor: torch.Tensor,
embed_dtype: "EmbedDType | MmMetadataDType",