Taejun Kim commited on
Commit
b1d66c1
1 Parent(s): 27b1390

Add analyze()

Browse files
Files changed (3) hide show
  1. app.py +17 -4
  2. pre-requirements.txt +1 -1
  3. requirements.txt +2 -1
app.py CHANGED
@@ -1,7 +1,20 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import allin1
3
 
 
 
4
 
5
+ def greet(name, progress=gr.Progress(track_tqdm=True)):
6
+ result = allin1.analyze(
7
+ name,
8
+ keep_byproducts=True, # TODO: remove this
9
+ )
10
+
11
+ return result
12
+
13
+
14
+ with gr.Blocks() as demo:
15
+ name = gr.Audio(source='upload', type='filepath')
16
+ output = gr.Textbox(label="Output Box")
17
+ greet_btn = gr.Button("Greet")
18
+ greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
19
+
20
+ demo.queue().launch()
pre-requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
  --extra-index-url https://download.pytorch.org/whl/cpu
2
- torch
3
  torchaudio
 
1
  --extra-index-url https://download.pytorch.org/whl/cpu
2
+ torch==2.0.1
3
  torchaudio
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
- natten -f https://shi-labs.com/natten/wheels/cpu/torch2.0.0/index.html
 
2
  madmom @ git+https://github.com/CPJKU/madmom
3
  allin1
4
  gradio
 
1
+ -f https://shi-labs.com/natten/wheels/cpu/torch2.0.0/index.html
2
+ natten
3
  madmom @ git+https://github.com/CPJKU/madmom
4
  allin1
5
  gradio