Spaces:
Runtime error
Runtime error
Commit
·
6452498
1
Parent(s):
cff6b7f
Add template CSS
Browse files
app.py
CHANGED
@@ -43,7 +43,88 @@ def translate_and_classify(audio):
|
|
43 |
detected_emotion = emotion[0]["label"]
|
44 |
return transcription.text, detected_emotion
|
45 |
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
gr.Markdown("""
|
48 |
## Emotion Detection From Speech with Whisper
|
49 |
""")
|
|
|
43 |
detected_emotion = emotion[0]["label"]
|
44 |
return transcription.text, detected_emotion
|
45 |
|
46 |
+
css = """
|
47 |
+
.gradio-container {
|
48 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
49 |
+
}
|
50 |
+
.gr-button {
|
51 |
+
color: white;
|
52 |
+
border-color: black;
|
53 |
+
background: black;
|
54 |
+
}
|
55 |
+
input[type='range'] {
|
56 |
+
accent-color: black;
|
57 |
+
}
|
58 |
+
.dark input[type='range'] {
|
59 |
+
accent-color: #dfdfdf;
|
60 |
+
}
|
61 |
+
.container {
|
62 |
+
max-width: 730px;
|
63 |
+
margin: auto;
|
64 |
+
padding-top: 1.5rem;
|
65 |
+
}
|
66 |
+
#gallery {
|
67 |
+
min-height: 22rem;
|
68 |
+
margin-bottom: 15px;
|
69 |
+
margin-left: auto;
|
70 |
+
margin-right: auto;
|
71 |
+
border-bottom-right-radius: .5rem !important;
|
72 |
+
border-bottom-left-radius: .5rem !important;
|
73 |
+
}
|
74 |
+
#gallery>div>.h-full {
|
75 |
+
min-height: 20rem;
|
76 |
+
}
|
77 |
+
.details:hover {
|
78 |
+
text-decoration: underline;
|
79 |
+
}
|
80 |
+
.gr-button {
|
81 |
+
white-space: nowrap;
|
82 |
+
}
|
83 |
+
.gr-button:focus {
|
84 |
+
border-color: rgb(147 197 253 / var(--tw-border-opacity));
|
85 |
+
outline: none;
|
86 |
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
87 |
+
--tw-border-opacity: 1;
|
88 |
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
89 |
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px var(--tw-ring-offset-width)) var(--tw-ring-color);
|
90 |
+
--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity));
|
91 |
+
--tw-ring-opacity: .5;
|
92 |
+
}
|
93 |
+
#advanced-btn {
|
94 |
+
font-size: .7rem !important;
|
95 |
+
line-height: 19px;
|
96 |
+
margin-top: 12px;
|
97 |
+
margin-bottom: 12px;
|
98 |
+
padding: 2px 8px;
|
99 |
+
border-radius: 14px !important;
|
100 |
+
}
|
101 |
+
#advanced-options {
|
102 |
+
display: none;
|
103 |
+
margin-bottom: 20px;
|
104 |
+
}
|
105 |
+
.footer {
|
106 |
+
margin-bottom: 45px;
|
107 |
+
margin-top: 35px;
|
108 |
+
text-align: center;
|
109 |
+
border-bottom: 1px solid #e5e5e5;
|
110 |
+
}
|
111 |
+
.footer>p {
|
112 |
+
font-size: .8rem;
|
113 |
+
display: inline-block;
|
114 |
+
padding: 0 10px;
|
115 |
+
transform: translateY(10px);
|
116 |
+
background: white;
|
117 |
+
}
|
118 |
+
.dark .footer {
|
119 |
+
border-color: #303030;
|
120 |
+
}
|
121 |
+
.dark .footer>p {
|
122 |
+
background: #0b0f19;
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
"""
|
127 |
+
with gr.Blocks(css = css) as demo:
|
128 |
gr.Markdown("""
|
129 |
## Emotion Detection From Speech with Whisper
|
130 |
""")
|