replicate / cog

Containers for machine learning
https://cog.run
Apache License 2.0
7.55k stars 525 forks source link

Integrated Gradio Demo App #1222

Open Ankur-singh opened 1 year ago

Ankur-singh commented 1 year ago

Description: The COG project is an incredible tool that simplifies the process of deploying machine learning models by just writing a handler. It enables users to get a complete working service with ease. However, during the development and testing stages, it would be extremely beneficial to have an integrated Gradio demo app. This will provide an interactive user interface that allows users to easily interact and test the model without the need for using CURL, Postman, or programming languages.

Feature Details:

Benefits:

Implementation Approach:

This feature will further enhance the usability and user experience of the COG project, making it an even more valuable tool for deploying machine learning models.

I am willing to take on this feature request as it presents an excellent opportunity for learning and growth.

### Tasks
hongchaodeng commented 1 year ago

This sounds very interesting! This would even make something like DragGAN works more easily on Replicate 😄

W.r.t. the details, I'm wondering how you could mount a Gradio app into a FastAPI app?

Ankur-singh commented 1 year ago

Gradio has built-in support for mounting to FastAPI app. Refer this doc.

hongchaodeng commented 1 year ago

Great!

I also found that HF has a feature that would turn Gradio app into a REST API endpoint: https://huggingface.co/spaces/tomsoderlund/rest-api-with-gradio

See this awesome demo: https://www.youtube.com/watch?v=mbn6yLcoyzo

This might be something interesting to look at and build on Replicate too!

apolinario commented 4 months ago

Maybe check this out: https://github.com/multimodalart/grog