Git Product home page Git Product logo

Comments (8)

abidlabs avatar abidlabs commented on July 28, 2024 10

For Docker, please try the passing in server_name="0.0.0.0" in your Interface object. So your main() would look like:

def main()
    gr.Interface(fn=greet, inputs="text", outputs="text", server_name="0.0.0.0").launch()

Here's an explanation for why you should use 0.0.0.0 inside of a Docker container to bind ports successfully.

from gradio.

abidlabs avatar abidlabs commented on July 28, 2024 6

Turns out you can easily upload Gradio apps to Heroku. Here's a step-by-step tutorial @TechyNilesh: https://medium.com/@abidlabs/how-to-deploy-a-machine-learning-ui-on-heroku-in-5-steps-b8cd3c9208e6

from gradio.

leungi avatar leungi commented on July 28, 2024 1

On a similar note, we'd like to deploy via Docker as well; it'll open up many deployment options!

Though the app launches internally, somehow the outside world doesn't see it.

Note that the /app contains the gradio app.py.

Sample Dockerfile

FROM python:3.7

RUN pip install gradio 

COPY . /app

WORKDIR /app

EXPOSE 7860

CMD ["python", "app.py"]

app.py

import gradio as gr

def greet(name):
    return "Hello " + name + "!"

def main():
    gr.Interface(fn=greet, inputs="text", outputs="text").launch()

if __name__ == '__main__':
	main()

from gradio.

abidlabs avatar abidlabs commented on July 28, 2024

Let me confirm what you mean: you want to host your interface with a permanent URL on Heroku?

from gradio.

TechyNilesh avatar TechyNilesh commented on July 28, 2024

Yes I want to host with permanent domain on heroku.
I deployed flask and streamlit app but facing issues on gradio.

So can you please provide the guideline?

from gradio.

abidlabs avatar abidlabs commented on July 28, 2024

from gradio.

leungi avatar leungi commented on July 28, 2024

Thanks for the prompt solution and reference doc @aliabd!

Glad to add gradio to our deployment options 🙏 for the work.

from gradio.

subhamChakraborty23 avatar subhamChakraborty23 commented on July 28, 2024

nice article,thanks for sharing.

from gradio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.