Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -117,7 +117,8 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="blue"),
|
|
117 |
anonymize = gr.Checkbox(value=True, label="Kişisel Verileri Anonimleştir")
|
118 |
clear_btn = gr.Button("Temizle", variant="secondary")
|
119 |
|
120 |
-
|
|
|
121 |
gr.HTML('<div class="tips"><b>💡 İpucu:</b> En iyi sonuçlar için gürültüsüz ortamlarda kayıt yapın.</div>')
|
122 |
|
123 |
with gr.Column(scale=2, elem_classes="container"):
|
@@ -149,22 +150,26 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="blue"),
|
|
149 |
</div>
|
150 |
""")
|
151 |
|
152 |
-
#
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
-
# Onay olmadan işlem yapılmasını engelle
|
157 |
-
def check_agreement(agreement, *args):
|
158 |
-
if not agreement:
|
159 |
-
return {"error": "Devam etmek için gizlilik koşullarını kabul etmelisiniz."}, "Lütfen gizlilik koşullarını kabul edin."
|
160 |
-
return process_audio(*args)
|
161 |
-
|
162 |
-
process_btn.click(
|
163 |
-
fn=check_agreement,
|
164 |
-
inputs=[privacy_agreement, audio_input, diarize, enhance, anonymize],
|
165 |
-
outputs=[json_output, result_text]
|
166 |
-
)
|
167 |
-
|
168 |
clear_btn.click(
|
169 |
lambda: (None, None, "Sistem hazır."),
|
170 |
outputs=[audio_input, result_text, status]
|
|
|
117 |
anonymize = gr.Checkbox(value=True, label="Kişisel Verileri Anonimleştir")
|
118 |
clear_btn = gr.Button("Temizle", variant="secondary")
|
119 |
|
120 |
+
# Transkribe Et butonunu başta pasif yap
|
121 |
+
process_btn = gr.Button("Transkribe Et", variant="primary", interactive=False)
|
122 |
gr.HTML('<div class="tips"><b>💡 İpucu:</b> En iyi sonuçlar için gürültüsüz ortamlarda kayıt yapın.</div>')
|
123 |
|
124 |
with gr.Column(scale=2, elem_classes="container"):
|
|
|
150 |
</div>
|
151 |
""")
|
152 |
|
153 |
+
# Gizlilik onay kutusu
|
154 |
+
privacy_agreement = gr.Checkbox(label="Gizlilik koşullarını okudum ve kabul ediyorum", value=False)
|
155 |
+
|
156 |
+
# Onay kutusu ile butonu bağla
|
157 |
+
def toggle_process_button(checked: bool):
|
158 |
+
return gr.Button.update(interactive=checked)
|
159 |
+
|
160 |
+
privacy_agreement.change(
|
161 |
+
fn=toggle_process_button,
|
162 |
+
inputs=privacy_agreement,
|
163 |
+
outputs=process_btn
|
164 |
+
)
|
165 |
+
|
166 |
+
# Process tuşuna tıklanınca çalışan orijinal fonksiyon
|
167 |
+
process_btn.click(
|
168 |
+
fn=process_audio,
|
169 |
+
inputs=[audio_input, diarize, enhance, anonymize],
|
170 |
+
outputs=[json_output, result_text]
|
171 |
+
)
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
clear_btn.click(
|
174 |
lambda: (None, None, "Sistem hazır."),
|
175 |
outputs=[audio_input, result_text, status]
|