Kalp97 commited on
Commit
5c59053
Β·
verified Β·
1 Parent(s): 4f790c1

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +207 -68
app.py CHANGED
@@ -43,112 +43,246 @@ def save_transcript(text):
43
  return path
44
 
45
  custom_css = """
46
- @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500&display=swap');
 
 
47
 
48
  body, .gradio-container {
49
- background: #080808 !important;
50
- font-family: 'DM Sans', sans-serif !important;
 
51
  }
 
52
  .gradio-container {
53
- max-width: 1000px !important;
54
  margin: 0 auto !important;
55
- padding: 48px 28px 80px !important;
56
  }
57
- .gradio-container::before {
58
- content: '';
59
- display: block;
60
- width: 36px;
61
- height: 2px;
62
- background: #c9a96e;
63
- margin-bottom: 32px;
64
  }
 
65
  .prose h1 {
66
- font-family: 'DM Serif Display', serif !important;
67
- font-size: 3rem !important;
68
- font-weight: 400 !important;
69
- color: #f0ece2 !important;
70
- letter-spacing: -0.02em !important;
71
- line-height: 1.05 !important;
 
 
 
 
 
72
  }
 
73
  .prose p {
74
- color: #555 !important;
75
- font-size: 0.9rem !important;
76
- font-weight: 300 !important;
77
- margin-top: 8px !important;
 
 
 
 
 
 
 
 
78
  }
79
- .contain, .gap { background: transparent !important; border: none !important; }
 
 
 
 
 
 
 
80
  .block {
81
- background: #0f0f0f !important;
82
- border: 1px solid #1c1c1c !important;
83
- border-radius: 14px !important;
 
84
  }
 
 
 
 
85
  .block label > span, label > span {
86
- font-family: 'DM Sans', sans-serif !important;
87
- font-size: 0.72rem !important;
88
  font-weight: 500 !important;
89
- color: #4a4a4a !important;
90
  text-transform: uppercase !important;
91
- letter-spacing: 0.12em !important;
92
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  textarea {
94
  background: transparent !important;
95
- color: #d4d0c8 !important;
96
- font-family: 'DM Sans', sans-serif !important;
97
- font-size: 0.92rem !important;
98
- line-height: 1.85 !important;
99
  font-weight: 300 !important;
100
  border: none !important;
 
101
  }
102
- textarea::placeholder { color: #2e2e2e !important; }
103
- input[type="checkbox"] { accent-color: #c9a96e !important; }
 
 
104
  button.primary {
105
- background: #c9a96e !important;
106
  border: none !important;
107
- border-radius: 11px !important;
108
- color: #080808 !important;
109
- font-family: 'DM Sans', sans-serif !important;
110
- font-size: 0.78rem !important;
111
- font-weight: 500 !important;
112
  letter-spacing: 0.12em !important;
113
  text-transform: uppercase !important;
114
- padding: 14px 28px !important;
115
  transition: all 0.2s ease !important;
116
  }
 
117
  button.primary:hover {
118
- background: #d4b87e !important;
 
119
  transform: translateY(-1px) !important;
120
- box-shadow: 0 6px 24px rgba(201,169,110,0.3) !important;
121
  }
 
 
 
 
122
  button.secondary {
123
  background: transparent !important;
124
- border: 1px solid #1e1e1e !important;
125
- border-radius: 11px !important;
126
- color: #4a4a4a !important;
127
- font-family: 'DM Sans', sans-serif !important;
128
- font-size: 0.78rem !important;
129
- font-weight: 500 !important;
130
  letter-spacing: 0.12em !important;
131
  text-transform: uppercase !important;
 
132
  transition: all 0.2s ease !important;
133
  }
134
- button.secondary:hover { border-color: #3a3a3a !important; color: #c8c4bc !important; }
 
 
 
 
 
 
 
 
 
 
 
135
  .tab-nav button {
136
- font-family: 'DM Sans', sans-serif !important;
137
- font-size: 0.78rem !important;
138
  font-weight: 500 !important;
139
- letter-spacing: 0.1em !important;
140
  text-transform: uppercase !important;
141
- color: #4a4a4a !important;
142
  background: transparent !important;
143
  border: none !important;
144
  border-bottom: 2px solid transparent !important;
 
145
  transition: all 0.2s !important;
146
  }
147
- .tab-nav button.selected { color: #c9a96e !important; border-bottom-color: #c9a96e !important; }
148
- ::-webkit-scrollbar { width: 3px; }
 
 
 
 
 
 
 
 
 
 
149
  ::-webkit-scrollbar-track { background: transparent; }
150
- ::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
 
 
151
  footer { display: none !important; }
 
 
 
 
 
 
 
 
 
152
  """
153
 
154
  LANGUAGES = [
@@ -157,13 +291,14 @@ LANGUAGES = [
157
  "Korean", "Arabic", "Russian", "Dutch", "Turkish"
158
  ]
159
 
160
- with gr.Blocks(title="KalpTranscript") as demo:
 
161
  gr.Markdown("""
162
- # KalpTranscript
163
- Turn any video or audio into clean, readable text β€” powered by OpenAI Whisper.
164
  """)
165
 
166
- with gr.Row():
167
  with gr.Column(scale=1):
168
  file_input = gr.File(
169
  label="Drop your file here",
@@ -172,8 +307,8 @@ Turn any video or audio into clean, readable text β€” powered by OpenAI Whisper.
172
  with gr.Row():
173
  model_choice = gr.Dropdown(
174
  choices=["tiny", "base", "small", "medium"],
175
- value="small",
176
- label="Model"
177
  )
178
  language = gr.Dropdown(
179
  choices=LANGUAGES,
@@ -193,11 +328,15 @@ Turn any video or audio into clean, readable text β€” powered by OpenAI Whisper.
193
  with gr.Column(scale=1):
194
  with gr.Tabs():
195
  with gr.Tab("Transcript"):
196
- output = gr.Textbox(label="", lines=16, placeholder="Your transcript will appear here...")
 
 
 
 
197
  with gr.Tab("Download"):
198
- plain_output = gr.Textbox(label="Plain text", lines=10, visible=False)
199
  download_btn = gr.Button("Save as .txt", variant="secondary")
200
- download_file = gr.File(label="Download")
201
 
202
  submit_btn.click(
203
  fn=transcribe,
 
43
  return path
44
 
45
  custom_css = """
46
+ @import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=Inter:wght@300;400;500&display=swap');
47
+
48
+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
49
 
50
  body, .gradio-container {
51
+ background: #000000 !important;
52
+ font-family: 'Inter', sans-serif !important;
53
+ color: #EFECE3 !important;
54
  }
55
+
56
  .gradio-container {
57
+ max-width: 1100px !important;
58
  margin: 0 auto !important;
59
+ padding: 0 !important;
60
  }
61
+
62
+ /* ── Hero header ── */
63
+ .prose {
64
+ padding: 64px 48px 48px !important;
65
+ border-bottom: 1px solid #111 !important;
66
+ margin-bottom: 0 !important;
 
67
  }
68
+
69
  .prose h1 {
70
+ font-family: 'Syne', sans-serif !important;
71
+ font-size: 4rem !important;
72
+ font-weight: 700 !important;
73
+ color: #EFECE3 !important;
74
+ letter-spacing: -0.03em !important;
75
+ line-height: 1 !important;
76
+ margin-bottom: 0 !important;
77
+ }
78
+
79
+ .prose h1 span {
80
+ color: #58B8FF !important;
81
  }
82
+
83
  .prose p {
84
+ font-size: 0.88rem !important;
85
+ color: #3066BE !important;
86
+ font-weight: 400 !important;
87
+ margin-top: 12px !important;
88
+ letter-spacing: 0.08em !important;
89
+ text-transform: uppercase !important;
90
+ }
91
+
92
+ /* ── Main layout ── */
93
+ .contain, .gap {
94
+ background: transparent !important;
95
+ border: none !important;
96
  }
97
+
98
+ .main-row {
99
+ padding: 40px 48px !important;
100
+ gap: 32px !important;
101
+ align-items: flex-start !important;
102
+ }
103
+
104
+ /* ── All blocks ── */
105
  .block {
106
+ background: #080808 !important;
107
+ border: 1px solid #1a1a1a !important;
108
+ border-radius: 4px !important;
109
+ transition: border-color 0.2s !important;
110
  }
111
+
112
+ .block:hover { border-color: #3066BE !important; }
113
+
114
+ /* ── Labels ── */
115
  .block label > span, label > span {
116
+ font-family: 'Inter', sans-serif !important;
117
+ font-size: 0.68rem !important;
118
  font-weight: 500 !important;
119
+ color: #112D4E !important;
120
  text-transform: uppercase !important;
121
+ letter-spacing: 0.15em !important;
122
  }
123
+
124
+ /* ── File upload zone ── */
125
+ .file-upload, [data-testid="file"], .upload-container {
126
+ background: #050505 !important;
127
+ border: 1.5px dashed #1a2a3a !important;
128
+ border-radius: 4px !important;
129
+ transition: all 0.25s !important;
130
+ min-height: 160px !important;
131
+ }
132
+
133
+ .file-upload:hover, [data-testid="file"]:hover {
134
+ border-color: #3066BE !important;
135
+ background: #060d1a !important;
136
+ }
137
+
138
+ .file-upload .wrap {
139
+ display: flex !important;
140
+ flex-direction: column !important;
141
+ align-items: center !important;
142
+ justify-content: center !important;
143
+ gap: 10px !important;
144
+ padding: 40px !important;
145
+ }
146
+
147
+ .file-upload .wrap svg {
148
+ color: #3066BE !important;
149
+ width: 28px !important;
150
+ height: 28px !important;
151
+ opacity: 0.6 !important;
152
+ }
153
+
154
+ .file-upload .wrap span {
155
+ font-size: 0.82rem !important;
156
+ color: #2a3a4a !important;
157
+ font-family: 'Inter', sans-serif !important;
158
+ }
159
+
160
+ /* ── Dropdowns ── */
161
+ .wrap-inner, select {
162
+ background: #080808 !important;
163
+ border: 1px solid #1a1a1a !important;
164
+ border-radius: 4px !important;
165
+ color: #EFECE3 !important;
166
+ font-family: 'Inter', sans-serif !important;
167
+ font-size: 0.85rem !important;
168
+ }
169
+
170
+ /* ── Radio buttons ── */
171
+ .wrap.svelte-12cmxck, .wrap.svelte-1p9xokt {
172
+ gap: 8px !important;
173
+ }
174
+
175
+ input[type="radio"] { accent-color: #3066BE !important; }
176
+ input[type="checkbox"] { accent-color: #3066BE !important; }
177
+
178
+ .radio-group label, .checkbox-group label {
179
+ font-size: 0.82rem !important;
180
+ color: #EFECE3 !important;
181
+ font-family: 'Inter', sans-serif !important;
182
+ }
183
+
184
+ /* ── Textarea / output ── */
185
  textarea {
186
  background: transparent !important;
187
+ color: #EFECE3 !important;
188
+ font-family: 'Inter', sans-serif !important;
189
+ font-size: 0.9rem !important;
190
+ line-height: 1.9 !important;
191
  font-weight: 300 !important;
192
  border: none !important;
193
+ letter-spacing: 0.01em !important;
194
  }
195
+
196
+ textarea::placeholder { color: #1a1a1a !important; }
197
+
198
+ /* ── Primary button ── */
199
  button.primary {
200
+ background: #3066BE !important;
201
  border: none !important;
202
+ border-radius: 4px !important;
203
+ color: #F9F7F7 !important;
204
+ font-family: 'Syne', sans-serif !important;
205
+ font-size: 0.82rem !important;
206
+ font-weight: 600 !important;
207
  letter-spacing: 0.12em !important;
208
  text-transform: uppercase !important;
209
+ padding: 15px 32px !important;
210
  transition: all 0.2s ease !important;
211
  }
212
+
213
  button.primary:hover {
214
+ background: #58B8FF !important;
215
+ color: #000000 !important;
216
  transform: translateY(-1px) !important;
 
217
  }
218
+
219
+ button.primary:active { transform: translateY(0) !important; }
220
+
221
+ /* ── Secondary button ── */
222
  button.secondary {
223
  background: transparent !important;
224
+ border: 1px solid #1a1a1a !important;
225
+ border-radius: 4px !important;
226
+ color: #2a3a4a !important;
227
+ font-family: 'Syne', sans-serif !important;
228
+ font-size: 0.82rem !important;
229
+ font-weight: 600 !important;
230
  letter-spacing: 0.12em !important;
231
  text-transform: uppercase !important;
232
+ padding: 15px 32px !important;
233
  transition: all 0.2s ease !important;
234
  }
235
+
236
+ button.secondary:hover {
237
+ border-color: #3066BE !important;
238
+ color: #58B8FF !important;
239
+ }
240
+
241
+ /* ── Tabs ── */
242
+ .tab-nav {
243
+ border-bottom: 1px solid #111 !important;
244
+ margin-bottom: 0 !important;
245
+ }
246
+
247
  .tab-nav button {
248
+ font-family: 'Inter', sans-serif !important;
249
+ font-size: 0.72rem !important;
250
  font-weight: 500 !important;
251
+ letter-spacing: 0.12em !important;
252
  text-transform: uppercase !important;
253
+ color: #2a3a4a !important;
254
  background: transparent !important;
255
  border: none !important;
256
  border-bottom: 2px solid transparent !important;
257
+ padding: 12px 20px !important;
258
  transition: all 0.2s !important;
259
  }
260
+
261
+ .tab-nav button.selected {
262
+ color: #58B8FF !important;
263
+ border-bottom-color: #58B8FF !important;
264
+ }
265
+
266
+ /* ── Progress bar ── */
267
+ .progress-bar { background: #3066BE !important; }
268
+ .progress-bar-wrap { background: #111 !important; border-radius: 0 !important; }
269
+
270
+ /* ── Scrollbar ── */
271
+ ::-webkit-scrollbar { width: 2px; }
272
  ::-webkit-scrollbar-track { background: transparent; }
273
+ ::-webkit-scrollbar-thumb { background: #1a2a3a; border-radius: 0; }
274
+
275
+ /* ── Footer ── */
276
  footer { display: none !important; }
277
+
278
+ /* ── Bottom credit bar ── */
279
+ .credit-bar {
280
+ padding: 20px 48px !important;
281
+ border-top: 1px solid #0a0a0a !important;
282
+ display: flex !important;
283
+ align-items: center !important;
284
+ justify-content: space-between !important;
285
+ }
286
  """
287
 
288
  LANGUAGES = [
 
291
  "Korean", "Arabic", "Russian", "Dutch", "Turkish"
292
  ]
293
 
294
+ with gr.Blocks(title="Kalp Transcript β€” Kalpi Edition") as demo:
295
+
296
  gr.Markdown("""
297
+ # Kalp <span>Transcript</span>
298
+ Created by Kalpi Edition
299
  """)
300
 
301
+ with gr.Row(elem_classes=["main-row"]):
302
  with gr.Column(scale=1):
303
  file_input = gr.File(
304
  label="Drop your file here",
 
307
  with gr.Row():
308
  model_choice = gr.Dropdown(
309
  choices=["tiny", "base", "small", "medium"],
310
+ value="tiny",
311
+ label="Model β€” tiny = fastest Β· medium = best accuracy"
312
  )
313
  language = gr.Dropdown(
314
  choices=LANGUAGES,
 
328
  with gr.Column(scale=1):
329
  with gr.Tabs():
330
  with gr.Tab("Transcript"):
331
+ output = gr.Textbox(
332
+ label="",
333
+ lines=18,
334
+ placeholder="Your transcript will appear here..."
335
+ )
336
  with gr.Tab("Download"):
337
+ plain_output = gr.Textbox(label="Plain text", lines=12, visible=False)
338
  download_btn = gr.Button("Save as .txt", variant="secondary")
339
+ download_file = gr.File(label="")
340
 
341
  submit_btn.click(
342
  fn=transcribe,