Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,39 @@ import sqlite3
|
|
24 |
# Define the passcode
|
25 |
PASSCODE = "show_feedback_db"
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
# Function to save feedback or provide access to the database file
|
28 |
def handle_feedback(feedback):
|
29 |
feedback = feedback.strip() # Clean up leading/trailing whitespace
|
@@ -266,39 +299,6 @@ def upload_and_manage(file, language, mode="transcription"):
|
|
266 |
|
267 |
# Gradio Interface with Tabs
|
268 |
def build_interface():
|
269 |
-
css = """
|
270 |
-
/* Adjust row height */
|
271 |
-
.dataframe-container tr {
|
272 |
-
height: 50px !important;
|
273 |
-
}
|
274 |
-
|
275 |
-
/* Ensure text wrapping and prevent overflow */
|
276 |
-
.dataframe-container td {
|
277 |
-
white-space: normal !important;
|
278 |
-
word-break: break-word !important;
|
279 |
-
}
|
280 |
-
|
281 |
-
/* Set column widths */
|
282 |
-
[data-testid="block-container"] .scrolling-dataframe th:nth-child(1),
|
283 |
-
[data-testid="block-container"] .scrolling-dataframe td:nth-child(1) {
|
284 |
-
width: 6%; /* Start column */
|
285 |
-
}
|
286 |
-
|
287 |
-
[data-testid="block-container"] .scrolling-dataframe th:nth-child(2),
|
288 |
-
[data-testid="block-container"] .scrolling-dataframe td:nth-child(2) {
|
289 |
-
width: 47%; /* Original text */
|
290 |
-
}
|
291 |
-
|
292 |
-
[data-testid="block-container"] .scrolling-dataframe th:nth-child(3),
|
293 |
-
[data-testid="block-container"] .scrolling-dataframe td:nth-child(3) {
|
294 |
-
width: 47%; /* Translated text */
|
295 |
-
}
|
296 |
-
|
297 |
-
[data-testid="block-container"] .scrolling-dataframe th:nth-child(4),
|
298 |
-
[data-testid="block-container"] .scrolling-dataframe td:nth-child(4) {
|
299 |
-
width: 0%; /* End column */
|
300 |
-
}
|
301 |
-
"""
|
302 |
with gr.Blocks(css=css) as demo:
|
303 |
gr.Markdown("## Video Localization")
|
304 |
with gr.Row():
|
|
|
24 |
# Define the passcode
|
25 |
PASSCODE = "show_feedback_db"
|
26 |
|
27 |
+
css = """
|
28 |
+
/* Adjust row height */
|
29 |
+
.dataframe-container tr {
|
30 |
+
height: 50px !important;
|
31 |
+
}
|
32 |
+
|
33 |
+
/* Ensure text wrapping and prevent overflow */
|
34 |
+
.dataframe-container td {
|
35 |
+
white-space: normal !important;
|
36 |
+
word-break: break-word !important;
|
37 |
+
}
|
38 |
+
|
39 |
+
/* Set column widths */
|
40 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(1),
|
41 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(1) {
|
42 |
+
width: 6%; /* Start column */
|
43 |
+
}
|
44 |
+
|
45 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(2),
|
46 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(2) {
|
47 |
+
width: 47%; /* Original text */
|
48 |
+
}
|
49 |
+
|
50 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(3),
|
51 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(3) {
|
52 |
+
width: 47%; /* Translated text */
|
53 |
+
}
|
54 |
+
|
55 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(4),
|
56 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(4) {
|
57 |
+
display: none !important;
|
58 |
+
}
|
59 |
+
"""
|
60 |
# Function to save feedback or provide access to the database file
|
61 |
def handle_feedback(feedback):
|
62 |
feedback = feedback.strip() # Clean up leading/trailing whitespace
|
|
|
299 |
|
300 |
# Gradio Interface with Tabs
|
301 |
def build_interface():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
with gr.Blocks(css=css) as demo:
|
303 |
gr.Markdown("## Video Localization")
|
304 |
with gr.Row():
|