freddyaboulton HF Staff commited on
Commit
1c349cd
·
verified ·
1 Parent(s): 4dd35a7

Commit 3: Add 35 file(s)

Browse files
demos/native_plots/bar_plot_demo.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from data import temp_sensor_data, food_rating_data
3
 
4
  with gr.Blocks() as bar_plots:
5
  with gr.Row():
 
1
  import gradio as gr
2
+ from data import temp_sensor_data, food_rating_data # type: ignore
3
 
4
  with gr.Blocks() as bar_plots:
5
  with gr.Row():
demos/native_plots/line_plot_demo.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from data import temp_sensor_data, food_rating_data
3
 
4
  with gr.Blocks() as line_plots:
5
  with gr.Row():
 
1
  import gradio as gr
2
+ from data import temp_sensor_data, food_rating_data # type: ignore
3
 
4
  with gr.Blocks() as line_plots:
5
  with gr.Row():
demos/native_plots/run.ipynb CHANGED
@@ -1 +1 @@
1
- {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: native_plots"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio vega_datasets pandas "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/bar_plot_demo.py\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/data.py\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/line_plot_demo.py\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/scatter_plot_demo.py"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "from scatter_plot_demo import scatter_plots\n", "from line_plot_demo import line_plots\n", "from bar_plot_demo import bar_plots\n", "\n", "with gr.Blocks() as demo:\n", " with gr.Tabs():\n", " with gr.TabItem(\"Line Plot\"):\n", " line_plots.render()\n", " with gr.TabItem(\"Scatter Plot\"):\n", " scatter_plots.render()\n", " with gr.TabItem(\"Bar Plot\"):\n", " bar_plots.render()\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
 
1
+ {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: native_plots"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio vega_datasets pandas "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/bar_plot_demo.py\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/data.py\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/line_plot_demo.py\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/native_plots/scatter_plot_demo.py"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "from scatter_plot_demo import scatter_plots # type: ignore\n", "from line_plot_demo import line_plots # type: ignore\n", "from bar_plot_demo import bar_plots # type: ignore\n", "\n", "with gr.Blocks() as demo:\n", " with gr.Tabs():\n", " with gr.TabItem(\"Line Plot\"):\n", " line_plots.render()\n", " with gr.TabItem(\"Scatter Plot\"):\n", " scatter_plots.render()\n", " with gr.TabItem(\"Bar Plot\"):\n", " bar_plots.render()\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
demos/native_plots/run.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
 
3
- from scatter_plot_demo import scatter_plots
4
- from line_plot_demo import line_plots
5
- from bar_plot_demo import bar_plots
6
 
7
  with gr.Blocks() as demo:
8
  with gr.Tabs():
 
1
  import gradio as gr
2
 
3
+ from scatter_plot_demo import scatter_plots # type: ignore
4
+ from line_plot_demo import line_plots # type: ignore
5
+ from bar_plot_demo import bar_plots # type: ignore
6
 
7
  with gr.Blocks() as demo:
8
  with gr.Tabs():
demos/native_plots/scatter_plot_demo.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from data import temp_sensor_data, food_rating_data
3
 
4
  with gr.Blocks() as scatter_plots:
5
  with gr.Row():
 
1
  import gradio as gr
2
+ from data import temp_sensor_data, food_rating_data # type: ignore
3
 
4
  with gr.Blocks() as scatter_plots:
5
  with gr.Row():
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
- gradio-client @ git+https://github.com/gradio-app/gradio@e2164bccbb0dae7c90049254eb1c5aac510b808a#subdirectory=client/python
2
- https://gradio-pypi-previews.s3.amazonaws.com/e2164bccbb0dae7c90049254eb1c5aac510b808a/gradio-5.42.0-py3-none-any.whl
3
  pypistats==1.1.0
4
  plotly
5
  matplotlib
 
1
+ gradio-client @ git+https://github.com/gradio-app/gradio@d9b272fd55451ff4fc1b0eb81b7f88ea9e89ac55#subdirectory=client/python
2
+ https://gradio-pypi-previews.s3.amazonaws.com/d9b272fd55451ff4fc1b0eb81b7f88ea9e89ac55/gradio-5.42.0-py3-none-any.whl
3
  pypistats==1.1.0
4
  plotly
5
  matplotlib
run.py CHANGED
@@ -44,7 +44,7 @@ for p in sorted(os.listdir("./demos")):
44
  demo_module = importlib.import_module("run")
45
  else:
46
  demo_module = importlib.reload(demo_module)
47
- all_demos.append((p, demo_module.demo, False))
48
  except Exception as e:
49
  with gr.Blocks() as demo:
50
  gr.Markdown(f"Error loading demo: {e}")
 
44
  demo_module = importlib.import_module("run")
45
  else:
46
  demo_module = importlib.reload(demo_module)
47
+ all_demos.append((p, demo_module.demo, False)) # type: ignore
48
  except Exception as e:
49
  with gr.Blocks() as demo:
50
  gr.Markdown(f"Error loading demo: {e}")