Open-Assistant
Open-Assistant copied to clipboard
Create REST API client class to call the detoxify model
This is follow up on https://github.com/LAION-AI/Open-Assistant/issues/38 and https://github.com/LAION-AI/Open-Assistant/tree/main/notebooks/detoxify-evaluation.
- Use the hugginface hosted inference API to host and expose the
multilingual
variant of the 'unitaryai/detoxify' models and make it available for calls from us. - Clarify with the ml-team / admins on discord how we get hf-credits for inference-calls .
- Write an asynchronous REST client class that will be used by the backend to make calls against the detoxify endpoint at HF.
Hey! Would like to contribute to this project! @SzymonOzog do you need any help on that?
@Nil-Andreu Hi, help is always appreciated! If I create a function for accessing huggingface API from 1. will you be able to write the rest client that handles the requests from 3?
@SzymonOzog Yes can try that! Will be my first contribution, so I will need to make the setup, ... I have already looked at the codebase, and I hope that when I get in touch with the code I could further contribute more in other issues.
@Nil-Andreu Amazing! I've made a pr with the function for getting detoxify classification (https://github.com/LAION-AI/Open-Assistant/pull/362) You can start working on it as soon as it gets accepted
reagarding 2.: They have a limited free access that runs on the cpu and is rate limited:
The free Inference API may be rate limited for heavy use cases. We try to balance the loads evenly between all our available resources, and favoring steady flows of requests. If your account suddenly sends 10k requests then you’re likely to receive 503 errors saying models are loading. In order to prevent that, you should instead try to start running queries smoothly from 0 to 10k over the course of a few minutes.
Also there is an option to pay for better accelerators
Perfect thanks!
With 3., by the "rest client class" you mean a fastapi endpoint?
I would say yes but I don't have much knowledge about our backend structure @andreaskoepf could you confirm?
Okay! I have started the following PR: here, for the creation of the api with fastapi. Could be also assigned and be collaborator of the project? Thanks!