Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gpt_oss/torch/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import math
import os
from dataclasses import dataclass
from typing import tuple

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Remove invalid typing import

from typing import tuple will raise an ImportError when this module is imported because typing only exposes Tuple (capitalized) in Python 3.12+. The return annotation already uses the built‑in tuple[...] and does not require any import, so this new line makes the package fail to import entirely.

Useful? React with 👍 / 👎.


import torch
import torch.distributed as dist
Expand Down Expand Up @@ -82,7 +83,7 @@ def __init__(
self.ntk_beta = ntk_beta
self.device = device

def _compute_concentration_and_inv_freq(self) -> torch.Tensor:
def _compute_concentration_and_inv_freq(self) -> tuple[float, torch.Tensor]:
"""See YaRN paper: https://arxiv.org/abs/2309.00071"""
freq = self.base ** (
torch.arange(0, self.head_dim, 2, dtype=torch.float, device=self.device)
Expand Down