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
62c96196
Unverified
Commit
62c96196
authored
1 year ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
fix for tests
parent
4909b470
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
semantic_router/llms/llamacpp.py
+4
-4
4 additions, 4 deletions
semantic_router/llms/llamacpp.py
tests/unit/llms/test_llm_llamacpp.py
+4
-1
4 additions, 1 deletion
tests/unit/llms/test_llm_llamacpp.py
with
8 additions
and
5 deletions
semantic_router/llms/llamacpp.py
+
4
−
4
View file @
62c96196
...
...
@@ -10,9 +10,9 @@ from semantic_router.utils.logger import logger
class
LlamaCppLLM
(
BaseLLM
):
llm
:
Optional
[
Llama
]
=
None
temperature
:
Optional
[
float
]
=
None
max_tokens
:
Optional
[
int
]
=
None
llm
:
Llama
temperature
:
float
max_tokens
:
int
grammar
:
Optional
[
LlamaGrammar
]
=
None
def
__init__
(
...
...
@@ -24,7 +24,7 @@ class LlamaCppLLM(BaseLLM):
):
if
not
llm
:
raise
ValueError
(
"
`llama_cpp.Llama` llm is required
"
)
super
().
__init__
(
name
=
name
)
super
().
__init__
(
name
=
name
,
llm
=
llm
,
temperature
=
temperature
,
max_tokens
=
max_tokens
)
self
.
llm
=
llm
self
.
temperature
=
temperature
self
.
max_tokens
=
max_tokens
...
...
This diff is collapsed.
Click to expand it.
tests/unit/llms/test_llm_llamacpp.py
+
4
−
1
View file @
62c96196
...
...
@@ -3,10 +3,13 @@ import pytest
from
semantic_router.llms
import
LlamaCppLLM
from
semantic_router.schema
import
Message
from
llama_cpp
import
Llama
@pytest.fixture
def
llamacpp_llm
(
mocker
):
llm
=
mocker
.
Mock
()
mock_llama
=
mocker
.
patch
(
"
llama_cpp.Llama
"
,
spec
=
Llama
)
llm
=
mock_llama
.
return_value
return
LlamaCppLLM
(
llm
=
llm
)
...
...
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