Skip to content
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

Added embeddings endpoint to server #374

Merged
merged 18 commits into from
Sep 6, 2023
Merged

Conversation

Montagon
Copy link
Contributor

@Montagon Montagon commented Sep 1, 2023

This PR include the endpoint for the embeddings in the same way that OpenAI supports it.

Copy link
Contributor

@javipacheco javipacheco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to finish this endpoint we should be sure that the embeddings are working fine. For that, we are using the SpaceCraftLocal example

We should change this example using the local embedding. Something like that

  val localOpenAi = OpenAI(host = "http://localhost:8081/")

  val model = localOpenAi.DEFAULT_SERIALIZATION

  val scope =
    Conversation(LocalVectorStore(OpenAIEmbeddings(localOpenAi.DEFAULT_EMBEDDING)))

....

@Intex32
Copy link
Member

Intex32 commented Sep 1, 2023

@Montagon have you tested streaming? when I tested that earlier, it hang forever. probably something was just wrong with my setup.

@Montagon
Copy link
Contributor Author

Montagon commented Sep 1, 2023

@Montagon have you tested streaming? when I tested that earlier, it hang forever. probably something was just wrong with my setup.

In which example did you try? I tried the SpaceCraftLocal with the new endpoint and it fails, not sure if related. But I'm checking it. Thanks!

@Intex32
Copy link
Member

Intex32 commented Sep 1, 2023

@Montagon have you tested streaming? when I tested that earlier, it hang forever. probably something was just wrong with my setup.

In which example did you try? I tried the SpaceCraftLocal with the new endpoint and it fails, not sure if related. But I'm checking it. Thanks!

I used Postman, the response hanging and never finished.

@Intex32
Copy link
Member

Intex32 commented Sep 4, 2023

@Montagon have you tested streaming? when I tested that earlier, it hang forever. probably something was just wrong with my setup.

As I found out, whether the request hangs or not depends on the length of the response from OpenAI:
Prompting to "Write an essay about climate change" does always hang, as an essay is a long text.
Short prompts do work as expected.
Now, the threshold appears to be around 80,000 chars (or bytes not sure) - mas o menos.

I haven't figured out why this is.

Intex32
Intex32 previously approved these changes Sep 5, 2023
Copy link
Member

@Intex32 Intex32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're set. Venga!

My issue with long prompts is going to be targeted in a different PR.

Copy link
Contributor

@javipacheco javipacheco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Montagon Montagon merged commit 4a8d3d0 into main Sep 6, 2023
@Montagon Montagon deleted the server-embeddings-endpoint branch September 6, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants