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
a57ed3f5
Unverified
Commit
a57ed3f5
authored
1 year ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
hybrid fixes
parent
b3fe444a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
semantic_router/layer.py
+3
-2
3 additions, 2 deletions
semantic_router/layer.py
with
3 additions
and
2 deletions
semantic_router/layer.py
+
3
−
2
View file @
a57ed3f5
import
numpy
as
np
import
numpy
as
np
from
numpy.linalg
import
norm
from
numpy.linalg
import
norm
from
tqdm.auto
import
tqdm
from
semantic_router.encoders
import
(
from
semantic_router.encoders
import
(
BaseEncoder
,
BaseEncoder
,
...
@@ -27,7 +28,7 @@ class DecisionLayer:
...
@@ -27,7 +28,7 @@ class DecisionLayer:
# if decisions list has been passed, we initialize index now
# if decisions list has been passed, we initialize index now
if
decisions
:
if
decisions
:
# initialize index now
# initialize index now
for
decision
in
decisions
:
for
decision
in
tqdm
(
decisions
)
:
self
.
_add_decision
(
decision
=
decision
)
self
.
_add_decision
(
decision
=
decision
)
def
__call__
(
self
,
text
:
str
)
->
str
|
None
:
def
__call__
(
self
,
text
:
str
)
->
str
|
None
:
...
@@ -134,7 +135,7 @@ class HybridDecisionLayer:
...
@@ -134,7 +135,7 @@ class HybridDecisionLayer:
# if decisions list has been passed, we initialize index now
# if decisions list has been passed, we initialize index now
if
decisions
:
if
decisions
:
# initialize index now
# initialize index now
for
decision
in
decisions
:
for
decision
in
tqdm
(
decisions
)
:
self
.
_add_decision
(
decision
=
decision
)
self
.
_add_decision
(
decision
=
decision
)
def
__call__
(
self
,
text
:
str
)
->
str
|
None
:
def
__call__
(
self
,
text
:
str
)
->
str
|
None
:
...
...
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