Spaces:
Runtime error
Runtime error
import gradio as gr | |
def calculator(イワシの値段, operation, num2): | |
if operation == "add": | |
return イワシの値段 + num2 | |
elif operation == "subtract": | |
return イワシの値段 - num2 | |
elif operation == "multiply": | |
return イワシの値段 * num2 | |
elif operation == "divide": | |
if num2 == 0: | |
raise gr.Error("Cannot divide by zero!") | |
return イワシの値段 / num2 | |
demo = gr.Interface( | |
calculator, | |
[ | |
"number", | |
gr.Radio(["add", "subtract", "multiply", "divide"]), | |
"number" | |
], | |
"number", | |
examples=[ | |
[5, "add", 3], | |
[4, "divide", 2], | |
[-4, "multiply", 2.5], | |
[0, "subtract", 1.2], | |
], | |
title="イワシの値段による「サンガスタジアム by KYOCERA」の観客動員予測", | |
description="「サンガスタジアム by KYOCERA」で行われる京都サンガFCのJ1リーグの直近の試合の観客動員数をイワシの値段から予測する。", | |
) | |
demo.launch() | |