Sfoglia il codice sorgente

rm python 3.11 idiom

Guillaume Wenzek 1 anno fa
parent
commit
b7b31a3978
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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))
 
     # 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
 
     return res

+ 1 - 1
ggml/third_party_ggml.py

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