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

Migrate to new model + proxy from server #5

Merged
merged 27 commits into from
Apr 19, 2023
Merged

Conversation

Grsmto
Copy link
Contributor

@Grsmto Grsmto commented Apr 17, 2023

  • Migrate to new model
  • Proxy API calls to server to avoid exposing token client-side
  • Cleanup model responses

@Grsmto Grsmto requested a review from gary149 April 17, 2023 08:51
@gary149 gary149 requested a review from julien-c April 17, 2023 09:15
@Grsmto Grsmto force-pushed the adrien-proxy-server branch from b5260af to dd24928 Compare April 18, 2023 08:42
src/routes/+page.svelte Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/routes/+page.svelte Outdated Show resolved Hide resolved
@coyotte508
Copy link
Member

coyotte508 commented Apr 18, 2023

I published @huggingface/inference@2.0.0-rc1: https://www.npmjs.com/package/@huggingface/inference?activeTab=versions. Do not hesitate to ask for things like this!

.env.example Outdated Show resolved Hide resolved
@Grsmto Grsmto force-pushed the adrien-proxy-server branch from 4ab6e6f to 3c5c332 Compare April 18, 2023 15:29
@Grsmto Grsmto requested a review from julien-c April 18, 2023 16:51
package.json Outdated Show resolved Hide resolved
Copy link
Member

@coyotte508 coyotte508 left a comment

Choose a reason for hiding this comment

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

LGTM (after removing patch-package), let's iterate 🚀

@Grsmto Grsmto merged commit c8d90f4 into main Apr 19, 2023
@Grsmto Grsmto deleted the adrien-proxy-server branch April 19, 2023 08:36
mishig25 pushed a commit that referenced this pull request Oct 23, 2023
* Order desc you.com results by text length

* You.com already provides texts from webpages
nsarrazin pushed a commit that referenced this pull request Oct 26, 2023
* add you.com integration

* [Feat] Add types  (#1)

* feat: add types

* feat: specify search provider

* [Feat] add return values (#3)

* feat: add types

* feat: specify search provider

* add values for ui

* add idea to gitignore

* lint and downgrade

* Revert "lint and downgrade"

This reverts commit fbfe012.

* Updates to you.com integration (#4)

* `npm run format`

* enable search when `YDC_API_KEY` is available

* typing nit

* enum WebSearchProvider

* eslint-disable-next-line no-shadow

* downgrade

* You.com already provides text snippets (#5)

* Order desc you.com results by text length

* You.com already provides texts from webpages

* add to env

* Update .env

Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>

* Update src/lib/server/websearch/searchWeb.ts

---------

Co-authored-by: David Li <david.li3100@gmail.com>
Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>
ice91 pushed a commit to ice91/chat-ui that referenced this pull request Oct 30, 2024
* use fork of hf.js to support fully custom endpoints for testing purpose

* proxy textGenerationStream call to the backend to hide token from client

* migrate to patch-package instead of pnpm

* fix issue after merge conflict

* use env var instead of hardcoded value for endpoint

* fix messages not being split between assistant/user

* fix stream response sometimes not split by token

* remove PUBLIC_ from private env variables + rename ENDPOINT to MODEL_ENDPOINT

* only set hf token as private, model can stay public

* move HF_TOKEN to a dynamic env

* fix env var import typo

* remove @microsoft/fetch-event-source

* update parameters to be identical to Python demo

* small refactor to avoid typing issue

* cleanup while loop

Co-authored-by: Julien Chaumond <julien@huggingface.co>

* make comment clearer on what is happening on stream chunks split

* fix chunk spliting not being handled properly

* cleanup model tokens sometimes containing "<|endoftext|>" text

* refactor how we proxy from the server to simplify logic

* use latest version of hf.js

* use .env + .env.local instead of .env.example

* rewrite logic to trim "<|endoftext|>" artifact properly

* update to latest hf.js

* expose env var to Docker during build time for deployment

* remove patch-package

---------

Co-authored-by: Julien Chaumond <julien@huggingface.co>
ice91 pushed a commit to ice91/chat-ui that referenced this pull request Oct 30, 2024
* add you.com integration

* [Feat] Add types  (huggingface#1)

* feat: add types

* feat: specify search provider

* [Feat] add return values (huggingface#3)

* feat: add types

* feat: specify search provider

* add values for ui

* add idea to gitignore

* lint and downgrade

* Revert "lint and downgrade"

This reverts commit fbfe012.

* Updates to you.com integration (huggingface#4)

* `npm run format`

* enable search when `YDC_API_KEY` is available

* typing nit

* enum WebSearchProvider

* eslint-disable-next-line no-shadow

* downgrade

* You.com already provides text snippets (huggingface#5)

* Order desc you.com results by text length

* You.com already provides texts from webpages

* add to env

* Update .env

Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>

* Update src/lib/server/websearch/searchWeb.ts

---------

Co-authored-by: David Li <david.li3100@gmail.com>
Co-authored-by: Mishig <mishig.davaadorj@coloradocollege.edu>
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.

3 participants