Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
97007ca3
Commit
97007ca3
authored
1 year ago
by
zahid-syed
Browse files
Options
Downloads
Patches
Plain Diff
unable to fix coverage for both MistralEncoder and MistralLLM
parent
61d22a75
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/unit/llms/test_llm_llamacpp.py
+0
-1
0 additions, 1 deletion
tests/unit/llms/test_llm_llamacpp.py
tests/unit/llms/test_llm_mistral.py
+9
-11
9 additions, 11 deletions
tests/unit/llms/test_llm_mistral.py
with
9 additions
and
12 deletions
tests/unit/llms/test_llm_llamacpp.py
+
0
−
1
View file @
97007ca3
...
@@ -15,7 +15,6 @@ def llamacpp_llm(mocker):
...
@@ -15,7 +15,6 @@ def llamacpp_llm(mocker):
class
TestLlamaCppLLM
:
class
TestLlamaCppLLM
:
def
test_llama_cpp_import_errors
(
self
,
llamacpp_llm
):
def
test_llama_cpp_import_errors
(
self
,
llamacpp_llm
):
with
patch
.
dict
(
"
sys.modules
"
,
{
"
llama_cpp
"
:
None
}):
with
patch
.
dict
(
"
sys.modules
"
,
{
"
llama_cpp
"
:
None
}):
with
pytest
.
raises
(
ImportError
)
as
error
:
with
pytest
.
raises
(
ImportError
)
as
error
:
...
...
This diff is collapsed.
Click to expand it.
tests/unit/llms/test_llm_mistral.py
+
9
−
11
View file @
97007ca3
...
@@ -3,8 +3,6 @@ import pytest
...
@@ -3,8 +3,6 @@ import pytest
from
semantic_router.llms
import
MistralAILLM
from
semantic_router.llms
import
MistralAILLM
from
semantic_router.schema
import
Message
from
semantic_router.schema
import
Message
from
unittest.mock
import
patch
@pytest.fixture
@pytest.fixture
def
mistralai_llm
(
mocker
):
def
mistralai_llm
(
mocker
):
...
@@ -13,16 +11,16 @@ def mistralai_llm(mocker):
...
@@ -13,16 +11,16 @@ def mistralai_llm(mocker):
class
TestMistralAILLM
:
class
TestMistralAILLM
:
def
test_mistral_llm_import_errors
(
self
):
#
def test_mistral_llm_import_errors(self):
with
patch
.
dict
(
"
sys.modules
"
,
{
"
mistralai
"
:
None
}):
#
with patch.dict("sys.modules", {"mistralai": None}):
with
pytest
.
raises
(
ImportError
)
as
error
:
#
with pytest.raises(ImportError) as error:
MistralAILLM
(
mistralai_api_key
=
"
random
"
)
#
MistralAILLM()
assert
(
#
assert (
"
Please install MistralAI to use MistralAI LLM.
"
#
"Please install MistralAI to use MistralAI LLM. "
"
You can install it with:
"
#
"You can install it with: "
"
`pip install
'
semantic-router[mistralai]
'
`
"
in
str
(
error
.
value
)
#
"`pip install 'semantic-router[mistralai]'`" in str(error.value)
)
#
)
def
test_mistralai_llm_init_with_api_key
(
self
,
mistralai_llm
):
def
test_mistralai_llm_init_with_api_key
(
self
,
mistralai_llm
):
assert
mistralai_llm
.
_client
is
not
None
,
"
Client should be initialized
"
assert
mistralai_llm
.
_client
is
not
None
,
"
Client should be initialized
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment