Skip to content

Commit cda13d9

Browse files
committed
remove further type ignore
1 parent 9241013 commit cda13d9

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

stubs/llama_cpp.pyi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from collections.abc import Sequence
2+
from os import PathLike
3+
from typing import Any, Literal
4+
5+
from typing_extensions import Self
6+
7+
class Llama:
8+
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
9+
@classmethod
10+
def from_pretrained(
11+
cls,
12+
repo_id: str,
13+
filename: str | None = None,
14+
additional_files: Sequence[str] | None = None,
15+
local_dir: str | PathLike[str] | None = None,
16+
local_dir_use_symlinks: bool | Literal['auto'] = 'auto',
17+
cache_dir: str | PathLike[str] | None = None,
18+
**kwargs: Any,
19+
) -> Self: ...

tests/models/test_outlines.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def transformers_multimodal_model() -> OutlinesModel:
153153
@pytest.fixture
154154
def llamacpp_model() -> OutlinesModel:
155155
outlines_model_llamacpp = outlines.models.llamacpp.from_llamacpp(
156-
llama_cpp.Llama.from_pretrained( # type: ignore
156+
llama_cpp.Llama.from_pretrained(
157157
repo_id='M4-ai/TinyMistral-248M-v2-Instruct-GGUF',
158158
filename='TinyMistral-248M-v2-Instruct.Q4_K_M.gguf',
159159
)
@@ -203,7 +203,7 @@ def binary_image() -> BinaryImage:
203203
pytest.param(
204204
'from_llamacpp',
205205
lambda: (
206-
llama_cpp.Llama.from_pretrained( # type: ignore
206+
llama_cpp.Llama.from_pretrained(
207207
repo_id='M4-ai/TinyMistral-248M-v2-Instruct-GGUF',
208208
filename='TinyMistral-248M-v2-Instruct.Q4_K_M.gguf',
209209
),
@@ -262,7 +262,7 @@ def test_init(model_loading_function_name: str, args: Callable[[], tuple[Any]])
262262
pytest.param(
263263
'from_llamacpp',
264264
lambda: (
265-
llama_cpp.Llama.from_pretrained( # type: ignore
265+
llama_cpp.Llama.from_pretrained(
266266
repo_id='M4-ai/TinyMistral-248M-v2-Instruct-GGUF',
267267
filename='TinyMistral-248M-v2-Instruct.Q4_K_M.gguf',
268268
),

0 commit comments

Comments
 (0)