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
b6d5c4f7
Unverified
Commit
b6d5c4f7
authored
1 year ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
fix for Encoder class
parent
4c49baf5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
semantic_router/schema.py
+3
-3
3 additions, 3 deletions
semantic_router/schema.py
with
3 additions
and
3 deletions
semantic_router/schema.py
+
3
−
3
View file @
b6d5c4f7
...
@@ -23,12 +23,12 @@ class RouteChoice(BaseModel):
...
@@ -23,12 +23,12 @@ class RouteChoice(BaseModel):
@dataclass
@dataclass
class
Encoder
:
class
Encoder
:
type
:
str
type
:
EncoderType
name
:
str
|
None
name
:
str
|
None
model
:
BaseEncoder
model
:
BaseEncoder
def
__init__
(
self
,
type
:
str
,
name
:
str
|
None
):
def
__init__
(
self
,
type
:
str
,
name
:
str
|
None
):
self
.
type
=
type
self
.
type
=
EncoderType
(
type
)
self
.
name
=
name
self
.
name
=
name
if
self
.
type
==
EncoderType
.
HUGGINGFACE
:
if
self
.
type
==
EncoderType
.
HUGGINGFACE
:
raise
NotImplementedError
raise
NotImplementedError
...
@@ -37,7 +37,7 @@ class Encoder:
...
@@ -37,7 +37,7 @@ class Encoder:
elif
self
.
type
==
EncoderType
.
COHERE
:
elif
self
.
type
==
EncoderType
.
COHERE
:
self
.
model
=
CohereEncoder
(
name
)
self
.
model
=
CohereEncoder
(
name
)
else
:
else
:
raise
NotImplemented
Error
raise
Value
Error
def
__call__
(
self
,
texts
:
list
[
str
])
->
list
[
list
[
float
]]:
def
__call__
(
self
,
texts
:
list
[
str
])
->
list
[
list
[
float
]]:
return
self
.
model
(
texts
)
return
self
.
model
(
texts
)
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