Spaces:
Running
Running
drop the Wordle game related tab and functions
#3
by
fffiloni
- opened
app.py
CHANGED
|
@@ -972,18 +972,6 @@ def process_video(video_input, audio_input):
|
|
| 972 |
# return 60 # Default to 60 seconds
|
| 973 |
|
| 974 |
|
| 975 |
-
def new_game_click(state):
|
| 976 |
-
"""Handle the 'New Game' button click."""
|
| 977 |
-
message = state.new_game()
|
| 978 |
-
feedback_history = state.get_feedback_history()
|
| 979 |
-
return state, feedback_history, message
|
| 980 |
-
|
| 981 |
-
|
| 982 |
-
def submit_guess_click(guess, state):
|
| 983 |
-
"""Handle the 'Submit Guess' button click."""
|
| 984 |
-
message = state.submit_guess(guess)
|
| 985 |
-
feedback_history = state.get_feedback_history()
|
| 986 |
-
return state, feedback_history, message
|
| 987 |
|
| 988 |
|
| 989 |
# Create Gradio interface
|
|
@@ -1052,28 +1040,6 @@ with gr.Blocks(
|
|
| 1052 |
outputs=video_output,
|
| 1053 |
)
|
| 1054 |
|
| 1055 |
-
with gr.TabItem("Wordle Game"):
|
| 1056 |
-
state = gr.State(WordleGame()) # Persist the WordleGame instance
|
| 1057 |
-
guess_input = gr.Textbox(label="Your guess (5 letters)", max_length=5)
|
| 1058 |
-
submit_btn = gr.Button("Submit Guess")
|
| 1059 |
-
new_game_btn = gr.Button("New Game")
|
| 1060 |
-
feedback_display = gr.HTML(label="Guesses")
|
| 1061 |
-
message_display = gr.Textbox(
|
| 1062 |
-
label="Message", interactive=False, value="Click 'New Game' to start."
|
| 1063 |
-
)
|
| 1064 |
-
# Connect the 'New Game' button
|
| 1065 |
-
new_game_btn.click(
|
| 1066 |
-
fn=new_game_click,
|
| 1067 |
-
inputs=[state],
|
| 1068 |
-
outputs=[state, feedback_display, message_display],
|
| 1069 |
-
)
|
| 1070 |
-
# Connect the 'Submit Guess' button
|
| 1071 |
-
submit_btn.click(
|
| 1072 |
-
fn=submit_guess_click,
|
| 1073 |
-
inputs=[guess_input, state],
|
| 1074 |
-
outputs=[state, feedback_display, message_display],
|
| 1075 |
-
)
|
| 1076 |
-
|
| 1077 |
gr.Markdown("## How it works")
|
| 1078 |
gr.Markdown("""
|
| 1079 |
1. The system extracts embeddings and landmarks from the input video
|
|
|
|
| 972 |
# return 60 # Default to 60 seconds
|
| 973 |
|
| 974 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 975 |
|
| 976 |
|
| 977 |
# Create Gradio interface
|
|
|
|
| 1040 |
outputs=video_output,
|
| 1041 |
)
|
| 1042 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1043 |
gr.Markdown("## How it works")
|
| 1044 |
gr.Markdown("""
|
| 1045 |
1. The system extracts embeddings and landmarks from the input video
|