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

Open source Inference widgets + optimize for community contributions #87

Merged
merged 27 commits into from
Jun 14, 2021

Conversation

julien-c
Copy link
Member

@julien-c julien-c commented Jun 9, 2021

TL;DR: demo deployment at https://60c228615382546a5cd01314--huggingface-widgets.netlify.app/

Screenshot 2021-06-10 at 17 00 37

What's the goal of this PR?

This PR's goal is to open source our Inference widgets to let community contributors check out the code and help us build widgets for new tasks in the future 🎉

What are non-immediate goals of this PR

  • compiling to Custom Elements (aka "Web components"): we are using SvelteKit (https://kit.svelte.dev/) to build this project with as small a boilerplate as possible, and as of now SvelteKit does not support packaging projects containing .ts files (see https://kit.svelte.dev/docs#packaging-caveats). No big deal IMO as SvelteKit is future-proof and will support this at some point.
  • no immediate plan to replace our widgets in moon-landing (the codebase that powers huggingface.co) by this exact code: the code is very easy to sync back/from (modulo a few import changes) so let's not over-optimize for this yet. For now we can just manually make sure that both codebases do not diverge.

Let me know your thoughts on the points above 💜💚

Implementation details

  • The SvelteKit app exposes a demo with all possible widgets
  • you can even use it to display the widget for any model (not just a hardcoded list), given that we have an API endpoint on hf.co to fetch data from just model id
  • CI/CD: you can find a URL to a Netlify deployment of the SvelteKit app in every commit touching widgets/

@wietsedv
Copy link

afbeelding

@julien-c julien-c marked this pull request as ready for review June 10, 2021 15:22
@julien-c
Copy link
Member Author

This is now ready for review 💜💚♥️💛

@julien-c julien-c linked an issue Jun 11, 2021 that may be closed by this pull request
@julien-c julien-c added the widgets About our Inference widgets label Jun 11, 2021
<IconLightning classNames="-ml-1 mr-1 text-yellow-500" />
Hosted inference API
</div>
<a target="_blank" href="/docs">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clicking on the link button shows Error. Probably non existent model. Error. Probably non existent model.

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, limitation of our demo app system here (not the full hf.co env)

Copy link
Member

Choose a reason for hiding this comment

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

Even the Error. Probably non existent model. in double? (see line 59 of widgets/src/routes/[...model].svelte)

Copy link
Member Author

Choose a reason for hiding this comment

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

@Pierrci yes no sure, I had issues locally for some reasons. Maybe a transient SvelteKit bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
widgets About our Inference widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open source our Inference widgets
5 participants