ZoyaRabail commited on
Commit
7f58900
Β·
verified Β·
1 Parent(s): 4b80a4a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -0
app.py ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Create HTML links that look like buttons
4
+ html_template = """
5
+ <div style="text-align: center; margin: 20px;">
6
+ <a href="{url}" style="
7
+ display: inline-block;
8
+ padding: 12px 24px;
9
+ background-color: #4CAF50;
10
+ color: white;
11
+ text-decoration: none;
12
+ border-radius: 5px;
13
+ font-weight: bold;
14
+ font-size: 16px;
15
+ margin: 10px;
16
+ ">{text}</a>
17
+ </div>
18
+ """
19
+
20
+ with gr.Blocks(title="AI Multi-Tool Hub", theme=gr.themes.Soft()) as demo:
21
+ gr.Markdown("# πŸ€– AI Multi-Tool Hub")
22
+ gr.Markdown("Select a tool to use:")
23
+
24
+ with gr.Row():
25
+ with gr.Column():
26
+ gr.Markdown("### πŸŽ™οΈ Speech to Text")
27
+ gr.Markdown("Convert audio to text using Whisper")
28
+ gr.HTML(html_template.format(url="/speech_to_text", text="Open Speech to Text"))
29
+
30
+ with gr.Column():
31
+ gr.Markdown("### 🌐 Translation")
32
+ gr.Markdown("Translate text between languages")
33
+ gr.HTML(html_template.format(url="/translation", text="Open Translation Tool"))
34
+
35
+ with gr.Row():
36
+ with gr.Column():
37
+ gr.Markdown("### 😊 Emotion Detection")
38
+ gr.Markdown("Detect emotions and tone in text")
39
+ gr.HTML(html_template.format(url="/emotions", text="Open Emotion Detection"))
40
+
41
+ with gr.Column():
42
+ gr.Markdown("### πŸ”Š Text to Speech")
43
+ gr.Markdown("Convert text to speech")
44
+ gr.HTML(html_template.format(url="/text_to_speech", text="Open Text to Speech"))
45
+
46
+ if __name__ == "__main__":
47
+ demo.launch()