Skip to main content

Gradio Space

Gradio provides an easy and intuitive interface for running a model from a list of inputs and displaying the outputs in formats such as images, audio, 3D objects, and more.

Create Gradio Space

In the process of Create Space, select Gradio SDK will create a Gradio Space. select sdk

Init

The Space system will create README.md and .gitattribute file automaticly after you create a new space repository. The status of this new space is Uninitialize. init space

To run the Gradio app, make a new file in the repository called app.py, and add the following code:

  import gradio as gr

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

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()

An easy way to new a file is in Files tab. Click "Add File" button, select "Create new file". Paste the code in edit box, and put the filename as "app.py". Then click "Create File". Create File

Running

The Space app will build automaticly after you commit app.py. You can check the app and files here Demo

You can change the code in app.py, create what you like in OpenCSG community!