Spaces:
Sleeping
Sleeping
amarchheda
commited on
Commit
·
52985bb
1
Parent(s):
a9bf14f
update
Browse files
app.py
CHANGED
@@ -1,6 +1,29 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(audio):
|
|
|
|
|
4 |
return audio
|
5 |
|
6 |
iface = gr.Interface(fn=greet,
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
|
4 |
+
WAVE_OUTPUT_FILE = "sample.wav"
|
5 |
+
|
6 |
+
def list_file_sizes():
|
7 |
+
path = "."
|
8 |
+
|
9 |
+
# Get list of all files only in the given directory
|
10 |
+
fun = lambda x : os.path.isfile(os.path.join(path,x))
|
11 |
+
files_list = filter(fun, os.listdir(path))
|
12 |
+
|
13 |
+
# Create a list of files in directory along with the size
|
14 |
+
size_of_file = [
|
15 |
+
(f,os.stat(os.path.join(path, f)).st_size)
|
16 |
+
for f in files_list
|
17 |
+
]
|
18 |
+
# Iterate over list of files along with size
|
19 |
+
# and print them one by one.
|
20 |
+
for f,s in size_of_file:
|
21 |
+
print("{} : {}MB".format(f, round(s/(1024*1024),3)))
|
22 |
+
|
23 |
|
24 |
def greet(audio):
|
25 |
+
with open(WAVE_OUTPUT_FILE, "wb") as file:
|
26 |
+
file.write(audio)
|
27 |
return audio
|
28 |
|
29 |
iface = gr.Interface(fn=greet,
|