Skip to content

Commit

Permalink
Hosts for DINO and CLIP are now normalized in terms of their suffix.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Gasser <[email protected]>
  • Loading branch information
ppanopticon committed Jan 15, 2024
1 parent bce794b commit e6f1ae2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class CLIP : ExternalWithFloatVectorDescriptorAnalyser<ContentElement<*>>() {
* @return A list of CLIP feature descriptors.
*/
override fun analyse(content: ContentElement<*>, hostname: String): FloatVectorDescriptor = when (content) {
is ImageContent -> FloatVectorDescriptor(UUID.randomUUID(), null, httpRequest(content, "$hostname/extract/clip_image"), true)
is TextContent -> FloatVectorDescriptor(UUID.randomUUID(), null, httpRequest(content, "$hostname/extract/clip_text"), true)
is ImageContent -> FloatVectorDescriptor(UUID.randomUUID(), null, httpRequest(content, "${hostname.removeSuffix("/")}/extract/clip_image"), true)
is TextContent -> FloatVectorDescriptor(UUID.randomUUID(), null, httpRequest(content, "${hostname.removeSuffix("/")}/extract/clip_text"), true)
else -> throw IllegalArgumentException("Content '$content' not supported")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ class DINO : ExternalWithFloatVectorDescriptorAnalyser<ImageContent>() {
* @return A list of CLIP feature descriptors.
*/
override fun analyse(content: ImageContent, hostname: String): FloatVectorDescriptor {
return FloatVectorDescriptor(UUID.randomUUID(), null, httpRequest(content, "$hostname/extract/dino"), true)
return FloatVectorDescriptor(UUID.randomUUID(), null, httpRequest(content, "${hostname.removeSuffix("/")}/extract/dino"), true)
}
}

0 comments on commit e6f1ae2

Please sign in to comment.