-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore Support base64 embedding format #485
Merged
sashabaranov
merged 17 commits into
sashabaranov:master
from
henomis:chore/473-support-base64-for-embeddings
Sep 11, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
227a7da
chore: support base64 embedding format
henomis 7009b74
fix: add sizeOfFloat32
henomis 5f1aceb
chore: refactor base64 decoding
henomis 38b1b57
chore: add tests
henomis 3233e0c
fix linting
henomis 071b654
fix test
henomis 2a465a1
fix return error
henomis 18c1913
fix: use smaller slice for tests
henomis 7eed976
fix [skip ci]
henomis 1e19595
chore: refactor test to consider CreateEmbeddings response
henomis 8b46949
trigger build
henomis 6089ca0
chore: remove named returns
henomis 250a433
chore: refactor code to simplify the understanding
henomis 94550a8
chore: tests have been refactored to match the encoding format passed…
henomis 29f6a9b
chore: fix tests
henomis a46764c
fix
henomis e36e114
fix
henomis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we update
res
otherwise?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes! My bad! I'll fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update! It's a bit hard to figure out
res
manipulations here. Could we please get rid of the namedres
return here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! It wasn't so clear, but I left it as I found it to minimize the modifications. However, now named returns have been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, I didn't realize how much more problematic would it make
if err != nil
returns!Sorry for bothering you so much, feelks like we've stumbled upon a tricky piece here :D I think that the
var embeddingResponse any = &response
creates a level of indirection which is not trivial to understand.What do you think of this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was one of my first ideas. Even though it will duplicate the code on calling twice
sendRequest
is the one with a good readability.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and tests have been refactored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!