Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -672,12 +672,12 @@ def custom_css():
|
|
| 672 |
# Bot- test gegen schädliche Bots die die Anwendung testen...
|
| 673 |
# Funktion zur Überprüfung der Benutzereingabe
|
| 674 |
# Funktion zur Überprüfung der Eingabe und Aktivierung der Hauptanwendung
|
| 675 |
-
def validate_input(
|
| 676 |
-
user_input_hashed = hash_input(
|
| 677 |
if user_input_hashed == correct_hash:
|
| 678 |
-
return "Richtig! Weiter gehts... ", True
|
| 679 |
else:
|
| 680 |
-
return "
|
| 681 |
|
| 682 |
|
| 683 |
#############################################################################################
|
|
@@ -727,8 +727,8 @@ with gr.Blocks(css=custom_css(), theme=themeAlex) as demo:
|
|
| 727 |
gr.Markdown(description_top)
|
| 728 |
with gr.Tab("KKG Chatbot"):
|
| 729 |
with gr.Row():
|
| 730 |
-
|
| 731 |
-
validate_btn = gr.Button("Validieren")
|
| 732 |
#validation_result = gr.Text(label="Validierungsergebnis")
|
| 733 |
|
| 734 |
with gr.Row():
|
|
@@ -929,7 +929,7 @@ with gr.Blocks(css=custom_css(), theme=themeAlex) as demo:
|
|
| 929 |
# Button Events....
|
| 930 |
#Validation Button
|
| 931 |
# Event-Handler für die Validierung
|
| 932 |
-
validate_btn.click(validate_input, inputs=[user_input, validate], outputs=[status_display, validate])
|
| 933 |
|
| 934 |
predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
|
| 935 |
predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_args)
|
|
|
|
| 672 |
# Bot- test gegen schädliche Bots die die Anwendung testen...
|
| 673 |
# Funktion zur Überprüfung der Benutzereingabe
|
| 674 |
# Funktion zur Überprüfung der Eingabe und Aktivierung der Hauptanwendung
|
| 675 |
+
def validate_input(user_input_validate, validate=False):
|
| 676 |
+
user_input_hashed = hash_input(user_input_validate)
|
| 677 |
if user_input_hashed == correct_hash:
|
| 678 |
+
return "Richtig! Weiter gehts... ", True, gr.Textbox(visible=False), gr.Button(visible=False)
|
| 679 |
else:
|
| 680 |
+
return "Falsche Antwort!!!!!!!!!", False, gr.Textbox(label = "", placeholder="Bitte tippen Sie das oben im Moodle Kurs angegebene Wort ein, um zu beweisen, dass Sie kein Bot sind.", visible=True, scale= 5), gr.Button("Validieren", visible = True)
|
| 681 |
|
| 682 |
|
| 683 |
#############################################################################################
|
|
|
|
| 727 |
gr.Markdown(description_top)
|
| 728 |
with gr.Tab("KKG Chatbot"):
|
| 729 |
with gr.Row():
|
| 730 |
+
user_input_validate = gr.Textbox(label = "", placeholder="Bitte tippen Sie das oben im Moodle Kurs angegebene Wort ein, um zu beweisen, dass Sie kein Bot sind.", visible=True, scale= 5)
|
| 731 |
+
validate_btn = gr.Button("Validieren", visible = True)
|
| 732 |
#validation_result = gr.Text(label="Validierungsergebnis")
|
| 733 |
|
| 734 |
with gr.Row():
|
|
|
|
| 929 |
# Button Events....
|
| 930 |
#Validation Button
|
| 931 |
# Event-Handler für die Validierung
|
| 932 |
+
validate_btn.click(validate_input, inputs=[user_input, validate], outputs=[status_display, validate, user_input_validate, validate_btn])
|
| 933 |
|
| 934 |
predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
|
| 935 |
predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_args)
|