Skip to content

Commit 893dc26

Browse files
committed
[Fix] Fix TypedDict import error for Python < 3.12
1 parent 1dcd2a6 commit 893dc26

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

xtuner/v1/module/attention/attn_outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TypedDict
1+
from typing_extensions import TypedDict
22

33
import torch
44

xtuner/v1/ops/attn_imp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import traceback
22
from functools import lru_cache
3-
from typing import TypedDict
3+
from typing_extensions import TypedDict
44

55
import torch
66
import torch.nn as nn

xtuner/v1/rl/base/controller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import math
22
import os
3-
from typing import Literal, TypedDict
3+
from typing import Literal
4+
from typing_extensions import TypedDict
45

56
import ray
67
import torch

xtuner/v1/rl/base/worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55
from itertools import chain
66
from pathlib import Path
7-
from typing import Dict, Iterable, List, TypeAlias, TypedDict, cast
7+
from typing import Dict, Iterable, List, TypeAlias, cast
88

99
import ray
1010
import requests
@@ -16,7 +16,7 @@
1616
from ray.actor import ActorClass, ActorProxy
1717
from torch.distributed.device_mesh import DeviceMesh, init_device_mesh
1818
from torch.distributed.tensor import DTensor
19-
from typing_extensions import NotRequired
19+
from typing_extensions import NotRequired, TypedDict
2020

2121
from transformers import AutoTokenizer
2222
from xtuner.v1.config.fsdp import FSDPConfig

0 commit comments

Comments
 (0)