Skip to content

Conversation

@coyotte508
Copy link
Member

@coyotte508 coyotte508 commented Apr 14, 2023

cc @Grsmto @vvmnnnkv @TimMikeladze

Inference endpoints do not accept model anymore.

Also, individual functions for the various tasks are exported, taking an additional optional accessToken parameter.

This is a big refacto even if the API keeps backwards compatibility, so I'd like some input :)


This moves the Inference API closer to @huggingface/hub, and conversely, we can also move the @huggingface/hub api closer to the inference module by offering a new HfHub("hf_...") class

@coyotte508 coyotte508 linked an issue Apr 14, 2023 that may be closed by this pull request
Copy link
Contributor

@vvmnnnkv vvmnnnkv left a comment

Choose a reason for hiding this comment

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

Really nice to have each task function in its own file!
Some suggestions:

  • Put task functions files to a folder like tasks, so they are not mixed with internal methods
  • Perhaps even split them to sub-folders like nlp, cv, multimodal, etc. following HF models classification
  • Move args/response types to corresponding task function file

@coyotte508
Copy link
Member Author

  • Put task functions files to a folder like tasks, so they are not mixed with internal methods

👍

  • Perhaps even split them to sub-folders like nlp, cv, multimodal, etc. following HF models classification

And we could move request and streamingRequest to a custom folder too !

  • Move args/response types to corresponding task function file

The thing is that some types are reused across tasks. Although we could duplicate the types I guess :) More future-proof

Good suggestions ^^

@coyotte508 coyotte508 force-pushed the 146-refacto-exports branch from 9640108 to 2168123 Compare April 17, 2023 13:38
@coyotte508
Copy link
Member Author

Merging to unblock parallel PRs, waiting a bit before release, feel free to comment in the meantime

@coyotte508 coyotte508 merged commit fd6ce52 into main Apr 17, 2023
@coyotte508 coyotte508 deleted the 146-refacto-exports branch April 17, 2023 13:41
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.

Refacto exports

3 participants