neoai-kterasawa commited on
Commit
c3a2338
·
1 Parent(s): 3f90d06

リンク追加

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -3,15 +3,19 @@ from typing import Final
3
  import gradio as gr # type: ignore
4
 
5
  import src.func as func
 
6
 
7
  DEFAULT_AMOUNT: Final[int] = 10_000
8
 
9
 
10
  def clear(text: str) -> str:
11
- return func.clear(text)
 
 
 
12
 
13
 
14
- def calculate(budget: int, text: str) -> tuple[str, list[list]]:
15
  try:
16
  return func.calculate(budget, text)
17
  except Exception as e:
@@ -40,6 +44,11 @@ with gr.Blocks(
40
  col_count=(4, "fixed"),
41
  )
42
 
 
 
 
 
 
43
  # click ------------------------------
44
  calculate_button.click(
45
  calculate,
 
3
  import gradio as gr # type: ignore
4
 
5
  import src.func as func
6
+ from src.model.choice import ChoiceWithBetTable
7
 
8
  DEFAULT_AMOUNT: Final[int] = 10_000
9
 
10
 
11
  def clear(text: str) -> str:
12
+ try:
13
+ return func.clear(text)
14
+ except Exception as e:
15
+ raise gr.Error(e)
16
 
17
 
18
+ def calculate(budget: int, text: str) -> tuple[str, ChoiceWithBetTable]:
19
  try:
20
  return func.calculate(budget, text)
21
  except Exception as e:
 
44
  col_count=(4, "fixed"),
45
  )
46
 
47
+ # リンク
48
+ gr.Markdown(
49
+ "[即パット](https://www.ipat.jra.go.jp/)<br>[netkeiba](https://www.netkeiba.com/)<br>"
50
+ )
51
+
52
  # click ------------------------------
53
  calculate_button.click(
54
  calculate,