Spaces:
Runtime error
Runtime error
Upload 5 files
Browse files- app_gradio.py +2 -1
- utils.py +3 -3
app_gradio.py
CHANGED
@@ -3,7 +3,8 @@ from utils import get_calculated_df, get_info, text2oddslist
|
|
3 |
|
4 |
|
5 |
def calculate(amount, text):
|
6 |
-
|
|
|
7 |
info = get_info(df)
|
8 |
|
9 |
# dfใฎๆดๅฝข
|
|
|
3 |
|
4 |
|
5 |
def calculate(amount, text):
|
6 |
+
odds_list = text2oddslist(text)
|
7 |
+
df = get_calculated_df(amount, odds_list)
|
8 |
info = get_info(df)
|
9 |
|
10 |
# dfใฎๆดๅฝข
|
utils.py
CHANGED
@@ -48,8 +48,9 @@ def _text2oddslist_pc(text: str) -> OdddsList:
|
|
48 |
def _text2oddslist_mobile(text: str) -> OdddsList:
|
49 |
odds_list: OdddsList = []
|
50 |
lines: list[str] = text.split("\n")
|
51 |
-
|
52 |
-
|
|
|
53 |
if "ใในใฆใ้ธๆ" in lines:
|
54 |
lines = lines[: lines.index("ใในใฆใ้ธๆ")]
|
55 |
for i in range(len(lines) // 3):
|
@@ -90,7 +91,6 @@ def get_calculated_df(amount: int, odds_list: OdddsList) -> pd.DataFrame:
|
|
90 |
)
|
91 |
df["refound"] = (df["buy"] * df["odds"]).astype(int)
|
92 |
df["profit"] = df["refound"] - amount
|
93 |
-
df = df
|
94 |
return df
|
95 |
|
96 |
|
|
|
48 |
def _text2oddslist_mobile(text: str) -> OdddsList:
|
49 |
odds_list: OdddsList = []
|
50 |
lines: list[str] = text.split("\n")
|
51 |
+
for strat_key in ("้ธๆ", "ใชใใบ", "็ตใฟๅใใ", "ใชใใบใ่ฆใฆๅๅฅ้ธๆ"):
|
52 |
+
if strat_key in lines:
|
53 |
+
lines = lines[lines.index(strat_key) + 1 :]
|
54 |
if "ใในใฆใ้ธๆ" in lines:
|
55 |
lines = lines[: lines.index("ใในใฆใ้ธๆ")]
|
56 |
for i in range(len(lines) // 3):
|
|
|
91 |
)
|
92 |
df["refound"] = (df["buy"] * df["odds"]).astype(int)
|
93 |
df["profit"] = df["refound"] - amount
|
|
|
94 |
return df
|
95 |
|
96 |
|