"## Gradio: How you can build a GUI within a Jupyter Notebook\n",
"\n",
"#### By Team JACT"
]
},
{
"cell_type": "markdown",
"id": "ba81c68d",
"metadata": {},
"source": [
"## Getting Started\n",
"\n",
"First, the gradio library must be installed on your computer. It requires Python 3.7 or later. If you have not done so already, please check your version of Python and run the following line of code:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "cdfdbb3e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Python 3.9.7\r\n"
]
}
],
"source": [
"!python --version"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "8f5edb3b",
"metadata": {},
"outputs": [],
"source": [
"#!pip install gradio"
]
},
{
"cell_type": "markdown",
"id": "f76c9232",
"metadata": {},
"source": [
"Next, import the library as follows:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "227461d8",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"import gradio as gr"
]
},
{
"cell_type": "markdown",
"id": "c3d4eb50",
"metadata": {},
"source": [
"Gradio can be used with a wide range of media-text, pictures, video, and sound. It is most useful for demonstrating machine learning algorithms.\n",
"\n",
"To get a feel for how it works, run the cell below this one. An interface will automatically pop up within the Jupyter Notebook. You can type your input directing into the interface."
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "92c83d6b",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running on local URL: http://127.0.0.1:7861/\n",
"\n",
"To create a public link, set `share=True` in `launch()`.\n"
]
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"900\"\n",
" height=\"500\"\n",
" src=\"http://127.0.0.1:7861/\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" \n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f8998c2e2b0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(<fastapi.applications.FastAPI at 0x7f8979fb7f40>,\n",
## Gradio: How you can build a GUI within a Jupyter Notebook
#### By Team JACT
%% Cell type:markdown id:ba81c68d tags:
## Getting Started
First, the gradio library must be installed on your computer. It requires Python 3.7 or later. If you have not done so already, please check your version of Python and run the following line of code:
%% Cell type:code id:cdfdbb3e tags:
``` python
!python--version
```
%% Output
Python 3.9.7
%% Cell type:code id:8f5edb3b tags:
``` python
#!pip install gradio
```
%% Cell type:markdown id:f76c9232 tags:
Next, import the library as follows:
%% Cell type:code id:227461d8 tags:
``` python
importgradioasgr
```
%% Cell type:markdown id:c3d4eb50 tags:
Gradio can be used with a wide range of media-text, pictures, video, and sound. It is most useful for demonstrating machine learning algorithms.
To get a feel for how it works, run the cell below this one. An interface will automatically pop up within the Jupyter Notebook. You can type your input directing into the interface.