File size: 1,493 Bytes
2f63626
10b61cb
2f63626
 
 
2570281
 
 
 
2f63626
 
 
10b61cb
2f63626
 
10b61cb
 
 
 
 
3e9b351
 
 
 
 
 
 
100ee4d
3e9b351
 
100ee4d
3e9b351
100ee4d
 
10b61cb
 
100ee4d
10b61cb
 
100ee4d
 
 
 
d8027d2
23e5396
5ec6795
 
 
 
2f63626
 
 
ff0c107
 
2f63626
5ec6795
2f63626
d8027d2
40b6dea
97325b8
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import gradio as gr
import subprocess



# https://github.com/catir/aligned-reaper/
# 


import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import subprocess


def setup():
    r0 = subprocess.run(["pwd"], capture_output=True, text=True)
    print('PWD::', r0.stdout)
    r1 = subprocess.run(["wget", "https://github.com/google/REAPER/archive/refs/heads/master.zip"], capture_output=True, text=True)
    print(r1.stdout)
    subprocess.run(["unzip", "./master.zip"])
    subprocess.run(["mv", "REAPER-master", "REAPER"])
    subprocess.run(["rm", "./master.zip"])
    subprocess.run(["cd", "REAPER"])
    subprocess.run(["mkdir", "build"])
    subprocess.run(["cd", "build"])
    r2 = subprocess.run(["cmake", ".."], capture_output=True, text=True)
    print(r2.stdout)
    r3 = subprocess.run(["make"], capture_output=True, text=True)
    print(r3.stdout)
    
    subprocess.run(["cd", "../.."])
    r9 = subprocess.run(["ls", "-la"], capture_output=True, text=True)
    print('LS::', r9.stdout)

                        
print('about to setup')
setup()





def f1():
    fig = plt.figure(figsize=(10,4))
    plt.axline((0,0),slope=1,color="darkgray")
    plt.xlabel("Vowel length (ms)")
    plt.ylabel("Consonant length (ms)")
    return(fig)

bl = gr.Blocks()
with bl:
    btn1 = gr.Button(value="The random prosody button")
    btn1.style(full_width=False, size="sm")

    pl1 = gr.Plot()
    
    btn1.click(f1, [], pl1)


if __name__ == "__main__":
    bl.launch()