aliabd commited on
Commit
13ea2ea
·
1 Parent(s): 5f8103e

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +8 -8
  2. requirements.txt +2 -0
  3. run.ipynb +1 -0
  4. run.py +15 -0
README.md CHANGED
@@ -1,12 +1,12 @@
 
1
  ---
2
- title: Plot Component 3-x
3
- emoji: 📉
4
- colorFrom: yellow
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 4.3.0
8
- app_file: app.py
9
  pinned: false
 
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+
2
  ---
3
+ title: plot_component_3-x
4
+ emoji: 🔥
5
+ colorFrom: indigo
6
+ colorTo: indigo
7
  sdk: gradio
8
+ sdk_version: 3.50.1
9
+ app_file: run.py
10
  pinned: false
11
+ hf_oauth: true
12
  ---
 
 
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ matplotlib
2
+ numpy
run.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: plot_component"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio matplotlib numpy"]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr \n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "Fs = 8000\n", "f = 5\n", "sample = 8000\n", "x = np.arange(sample)\n", "y = np.sin(2 * np.pi * f * x / Fs)\n", "plt.plot(x, y)\n", "\n", "with gr.Blocks() as demo:\n", " gr.Plot(value=plt)\n", "\n", "demo.launch()"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
run.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import matplotlib.pyplot as plt
3
+ import numpy as np
4
+
5
+ Fs = 8000
6
+ f = 5
7
+ sample = 8000
8
+ x = np.arange(sample)
9
+ y = np.sin(2 * np.pi * f * x / Fs)
10
+ plt.plot(x, y)
11
+
12
+ with gr.Blocks() as demo:
13
+ gr.Plot(value=plt)
14
+
15
+ demo.launch()