File size: 1,155 Bytes
bd3e2e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr

def generate_response(correction_intensity,
                      language_level,
                      buddy_personality,
                      language_choice,
                      user_query
                      ):
    # Convert input audio to text
    # Ask llm for response to text
    # Convert llm response to audio
    # Return converted llm response
    return user_query

demo = gr.Interface(
    fn=generate_response,
    inputs=[
        gr.Slider(
            minimum=1,
            maximum=5,
            step=1,
            label='Grammar Correction Intensity'
        ),
        gr.Dropdown(
            choices=['Beginner', 'Intermediate', 'Advanced'],
            label='Language Level'),
        gr.Dropdown(
            choices=['Formal Teacher', 'Flirty Friend', 'Sarcastic Bro'],
            label='Language Buddy Personality'),
        gr.Dropdown(
            choices=['English', 'Urdu', 'Japanese'],
            label='Language Choice'),
        gr.Audio(
            sources=["microphone"],
        )],
    outputs=[
        gr.Audio(label='User Query')
    ],
    title="AI Language Buddy"
)
demo.launch()