Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -249,14 +249,15 @@ def gradio_app():
|
|
249 |
# Use gr.Column to stack components vertically
|
250 |
with gr.Column():
|
251 |
file_input = gr.File(label="Upload Replay File", type="filepath", file_types=[".replay"])
|
252 |
-
checkboxes = gr.CheckboxGroup(["Nullify goal difference", "Ignore ties"])
|
253 |
submit_button = gr.Button("Generate Predictions")
|
254 |
plot_output = gr.Plot(label="Predictions")
|
255 |
download_button = gr.DownloadButton("Download Predictions", visible=False)
|
256 |
|
257 |
# Make plot on button click
|
258 |
def make_plot(replay_file, checkbox_options, progress=gr.Progress(track_tqdm=True)):
|
259 |
-
nullify_goal_difference
|
|
|
260 |
print(f"Processing file: {replay_file}")
|
261 |
replay_stem = os.path.splitext(os.path.basename(replay_file))[0]
|
262 |
preds_file = os.path.join(temp_dir, f"predictions_{replay_stem}_{options}.csv")
|
|
|
249 |
# Use gr.Column to stack components vertically
|
250 |
with gr.Column():
|
251 |
file_input = gr.File(label="Upload Replay File", type="filepath", file_types=[".replay"])
|
252 |
+
checkboxes = gr.CheckboxGroup(label="Options", choices=["Nullify goal difference", "Ignore ties"], type="index")
|
253 |
submit_button = gr.Button("Generate Predictions")
|
254 |
plot_output = gr.Plot(label="Predictions")
|
255 |
download_button = gr.DownloadButton("Download Predictions", visible=False)
|
256 |
|
257 |
# Make plot on button click
|
258 |
def make_plot(replay_file, checkbox_options, progress=gr.Progress(track_tqdm=True)):
|
259 |
+
nullify_goal_difference = 0 in checkbox_options
|
260 |
+
ignore_ties = 1 in checkbox_options
|
261 |
print(f"Processing file: {replay_file}")
|
262 |
replay_stem = os.path.splitext(os.path.basename(replay_file))[0]
|
263 |
preds_file = os.path.join(temp_dir, f"predictions_{replay_stem}_{options}.csv")
|