Browse Source

rm python 3.11 idiom

Guillaume Wenzek 1 year ago
parent
commit
b7b31a3978
2 changed files with 2 additions and 2 deletions
  1. 1 1
      ggml/ggml.py
  2. 1 1
      ggml/third_party_ggml.py

+ 1 - 1
ggml/ggml.py

@@ -141,7 +141,7 @@ def _strided_to_numpy(tensor_p: ggml_tensor_p) -> np.ndarray:
     res = _void_p_to_np_array(tensor.data, tuple(full_shape), numpy_dtype(tensor.type))
     res = _void_p_to_np_array(tensor.data, tuple(full_shape), numpy_dtype(tensor.type))
 
 
     # Extract the correct slice
     # Extract the correct slice
-    res = res[*(slice(0, n) for n in t_shape)]
+    res = res.__getitem__(*[slice(0, n) for n in t_shape])
     # TODO: we could handle transposition here
     # TODO: we could handle transposition here
 
 
     return res
     return res

+ 1 - 1
ggml/third_party_ggml.py

@@ -60,7 +60,7 @@ from typing import Type
 from typing import Callable
 from typing import Callable
 from typing import Tuple
 from typing import Tuple
 from typing import Dict
 from typing import Dict
-from typing import Self
+from typing_extensions import Self
 from typing import Any
 from typing import Any
 from pathlib import Path
 from pathlib import Path
 from typing import List, Optional, Sequence, Union
 from typing import List, Optional, Sequence, Union