utkarshshukla2912 commited on
Commit
c9589ea
·
1 Parent(s): 63d250f

base space

Browse files
Files changed (3) hide show
  1. app.py +18 -99
  2. pyproject.toml +8 -0
  3. uv.lock +0 -0
app.py CHANGED
@@ -9,19 +9,18 @@ BASE_URL = os.environ.get("BASE_URL", "")
9
 
10
  # Custom CSS for aesthetic design
11
  custom_css = """
12
- .health-status {
13
- display: flex;
14
- align-items: center;
15
- gap: 10px;
16
  padding: 15px;
17
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
18
- border-radius: 12px;
19
- margin-bottom: 20px;
 
20
  }
21
 
22
  .status-dot {
23
- width: 20px;
24
- height: 20px;
25
  border-radius: 50%;
26
  animation: pulse 2s infinite;
27
  margin-top: 25px;
@@ -49,90 +48,21 @@ custom_css = """
49
  }
50
  }
51
 
52
- .metric-card {
53
- background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
54
- padding: 15px;
55
- border-radius: 10px;
56
- margin: 5px;
57
- color: white;
58
- text-align: center;
59
- }
60
-
61
- .metric-label {
62
- font-size: 12px;
63
- opacity: 0.9;
64
- margin-bottom: 5px;
65
- }
66
-
67
- .metric-value {
68
- font-size: 24px;
69
- font-weight: bold;
70
- }
71
-
72
- .voice-card {
73
- background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
74
- padding: 10px;
75
- border-radius: 8px;
76
- margin: 5px 0;
77
- }
78
-
79
- .gradio-container {
80
- max-width: 1200px !important;
81
- margin: auto !important;
82
- }
83
-
84
- .main-title {
85
- text-align: center;
86
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
87
- -webkit-background-clip: text;
88
- -webkit-text-fill-color: transparent;
89
- background-clip: text;
90
- font-size: 48px;
91
- font-weight: bold;
92
- margin-bottom: 20px;
93
- margin-top: 0;
94
- }
95
-
96
- .subtitle {
97
- text-align: center;
98
- color: #666;
99
- font-size: 18px;
100
- margin-bottom: 30px;
101
- }
102
-
103
- /* Title bar behind the heading text */
104
  .title-bar {
105
  display: flex;
106
  align-items: center;
107
- justify-content: center;
108
  gap: 15px;
109
  margin-bottom: 20px;
110
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
111
  border-radius: 12px;
112
  padding: 8px 16px;
113
- height: 60px; /* compact header height */
114
  min-height: 60px;
115
  overflow: hidden;
 
116
  }
117
 
118
- /* Make title text solid and place gradient behind it */
119
- .title-bar .main-title {
120
- background: none !important;
121
- -webkit-text-fill-color: #ffffff !important;
122
- color: #ffffff !important;
123
- margin: 0;
124
- font-size: 22px; /* smaller title for compact header */
125
- line-height: 1.2;
126
- }
127
-
128
- .logo {
129
- height: 18px !important; /* ensure the image itself is small */
130
- width: auto !important;
131
- display: inline-block;
132
- margin-right: 8px;
133
- object-fit: contain;
134
- flex-shrink: 0;
135
- }
136
  """
137
 
138
 
@@ -252,9 +182,13 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
252
  dot_class = "status-dot-green" if is_healthy else "status-dot-red"
253
  return f"""
254
  <div class="title-bar">
255
- <img src="https://storage.googleapis.com/desivocal-prod/desi-vocal/logo.png" width="50" height="50">
256
- <h1 class='main-title'>RinggAI - Text-to-Speech</h1>
257
- <div class="status-dot {dot_class}" style="margin-top: 0;"></div>
 
 
 
 
258
  </div>
259
  """
260
 
@@ -282,16 +216,8 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
282
  )
283
 
284
  with gr.Column(scale=1):
285
- # Status Message
286
- # status_output = gr.Markdown("ℹ️ Ready to generate speech")
287
-
288
- # Audio Output
289
-
290
  audio_output = gr.Audio(label="Listen to your audio", type="filepath")
291
-
292
- # Metrics Display (hidden until available)
293
  metrics_header = gr.Markdown("### 📊 Generation Metrics", visible=False)
294
-
295
  metrics_output = gr.Code(
296
  label="Metrics", language="json", interactive=False, visible=False
297
  )
@@ -361,13 +287,6 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
361
  # Refresh health status on load
362
  demo.load(fn=get_title_with_status, outputs=[health_status])
363
 
364
- # Set up periodic refresh if Timer is available
365
- try:
366
- health_timer = gr.Timer(value=120)
367
- health_timer.tick(fn=get_title_with_status, outputs=[health_status])
368
- except Exception:
369
- pass # Timer not available in this Gradio version
370
-
371
  if __name__ == "__main__":
372
  demo.queue()
373
  demo.launch(share=False, server_name="0.0.0.0", server_port=7860)
 
9
 
10
  # Custom CSS for aesthetic design
11
  custom_css = """
12
+ .metric-card {
13
+ background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
 
 
14
  padding: 15px;
15
+ border-radius: 10px;
16
+ margin: 5px;
17
+ color: white;
18
+ text-align: center;
19
  }
20
 
21
  .status-dot {
22
+ width: 10px;
23
+ height: 10px;
24
  border-radius: 50%;
25
  animation: pulse 2s infinite;
26
  margin-top: 25px;
 
48
  }
49
  }
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  .title-bar {
52
  display: flex;
53
  align-items: center;
54
+ # justify-content: center;
55
  gap: 15px;
56
  margin-bottom: 20px;
57
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
58
  border-radius: 12px;
59
  padding: 8px 16px;
60
+ height: 100px; /* compact header height */
61
  min-height: 60px;
62
  overflow: hidden;
63
+ width: 100%
64
  }
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  """
67
 
68
 
 
182
  dot_class = "status-dot-green" if is_healthy else "status-dot-red"
183
  return f"""
184
  <div class="title-bar">
185
+
186
+ <img src="https://storage.googleapis.com/desivocal-prod/desi-vocal/logo.png" width="50" height="50">
187
+ <h1 class='main-title' style="margin-top: -3px;">
188
+ RinggAI - Text-to-Speech
189
+ <span class="status-dot {dot_class}" style="margin-top: 0;"></span>
190
+ </h1>
191
+
192
  </div>
193
  """
194
 
 
216
  )
217
 
218
  with gr.Column(scale=1):
 
 
 
 
 
219
  audio_output = gr.Audio(label="Listen to your audio", type="filepath")
 
 
220
  metrics_header = gr.Markdown("### 📊 Generation Metrics", visible=False)
 
221
  metrics_output = gr.Code(
222
  label="Metrics", language="json", interactive=False, visible=False
223
  )
 
287
  # Refresh health status on load
288
  demo.load(fn=get_title_with_status, outputs=[health_status])
289
 
 
 
 
 
 
 
 
290
  if __name__ == "__main__":
291
  demo.queue()
292
  demo.launch(share=False, server_name="0.0.0.0", server_port=7860)
pyproject.toml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "ringg-tts-v1-0"
3
+ version = "0.1.0"
4
+ requires-python = ">=3.10"
5
+ dependencies = [
6
+ "gradio>=5.49.1",
7
+ "requests>=2.32.5",
8
+ ]
uv.lock ADDED
The diff for this file is too large to render. See raw diff