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
6cb48dd4
Unverified
Commit
6cb48dd4
authored
6 months ago
by
Siraj R Aizlewood
Browse files
Options
Downloads
Patches
Plain Diff
Update layer.py
After a discussion with James we decided to just alter the existing update function.
parent
1f930a5f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
semantic_router/layer.py
+1
-17
1 addition, 17 deletions
semantic_router/layer.py
with
1 addition
and
17 deletions
semantic_router/layer.py
+
1
−
17
View file @
6cb48dd4
...
...
@@ -177,7 +177,7 @@ class RouteLayer:
index
:
BaseIndex
def
__init__
(
self
,
self
encoder
:
Optional
[
BaseEncoder
]
=
None
,
llm
:
Optional
[
BaseLLM
]
=
None
,
routes
:
Optional
[
List
[
Route
]]
=
None
,
...
...
@@ -832,22 +832,6 @@ class RouteLayer:
def
_get_route_names
(
self
)
->
List
[
str
]:
return
[
route
.
name
for
route
in
self
.
routes
]
def
update_route_thresholds
(
self
,
threshold_dict
:
Dict
[
str
,
float
]):
"""
Update thresholds for specified routes.
:param threshold_dict: A dictionary mapping route names to new threshold values.
:type threshold_dict: Dict[str, float]
"""
for
route_name
,
new_threshold
in
threshold_dict
.
items
():
route
=
self
.
get
(
route_name
)
if
route
:
old_threshold
=
route
.
score_threshold
route
.
score_threshold
=
new_threshold
logger
.
info
(
f
"
Updated threshold for route
'
{
route_name
}
'
from
{
old_threshold
}
to
{
new_threshold
}
"
)
else
:
logger
.
warning
(
f
"
Route
'
{
route_name
}
'
not found. Skipping threshold update.
"
)
def
threshold_random_search
(
...
...
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