Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
import matplotlib
|
| 6 |
+
matplotlib.use('Agg')
|
| 7 |
+
import matplotlib.pyplot as plt
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def f1():
|
| 11 |
+
fig = plt.figure(figsize=(6,5))
|
| 12 |
+
plt.axline((0,0),slope=1,color="darkgray")
|
| 13 |
+
plt.xlabel("Vowel length (ms)")
|
| 14 |
+
plt.ylabel("Consonant length (ms)")
|
| 15 |
+
return(fig)
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
bl = gr.Blocks()
|
| 19 |
+
with bl:
|
| 20 |
+
btn1 = gr.Button(value="The random prosody button")
|
| 21 |
+
|
| 22 |
+
pl1 = gr.Plot()
|
| 23 |
+
|
| 24 |
+
btn1.click(f1, [], pl1)
|