chrisjay commited on
Commit
45585f3
1 Parent(s): 54c00c3

initial files

Browse files
Files changed (2) hide show
  1. app.py +38 -0
  2. requirements.txt +0 -0
app.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+
4
+
5
+ HF_TOKEN = os.environ.get("HF_TOKEN")
6
+ print("is none?", HF_TOKEN is None)
7
+
8
+ def get_record(language,text,record):
9
+ # Save text and its corresponding record to flag
10
+
11
+ text =text.strip()
12
+ return f'Record for text {text} successfully saved to dataset! Thank You.'
13
+
14
+ title = 'African Crowdsource Speech'
15
+ description = 'A platform to contribute to your African language by recording your voice'
16
+
17
+ markdown = """# African Crowdsource Speech
18
+
19
+ A platform to contribute to your African language by recording your voice
20
+ """
21
+
22
+ # Get a dropdown of all African languages
23
+
24
+ # Interface design begins
25
+ block = gr.Blocks()
26
+ with block:
27
+ gr.Markdown(markdown)
28
+
29
+ with gr.Tab():
30
+ with gr.Row():
31
+ language = gr.inputs.Textbox(placeholder='Choose your language',label='Language')
32
+ text = gr.inputs.Textbox(placeholder='Write your text',label='Text')
33
+ record = gr.inputs.Audio(source="microphone",label='Record your voice')
34
+ output = gr.outputs.Textbox(type="str")
35
+
36
+ save = gr.Button("Save")
37
+ save.click(get_record, inputs=[language,text,record],outputs=output)
38
+
requirements.txt ADDED
File without changes