Spaces:
Sleeping
Sleeping
beau-badilla
commited on
Commit
•
657f2b1
1
Parent(s):
05b7756
Add app files
Browse files- app.py +149 -0
- util/__pycache__/champions.cpython-310.pyc +0 -0
- util/__pycache__/regions.cpython-310.pyc +0 -0
- util/champions.py +161 -0
- util/regions.py +14 -0
app.py
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio
|
2 |
+
|
3 |
+
from util.champions import champions
|
4 |
+
from util.regions import regions
|
5 |
+
|
6 |
+
|
7 |
+
def output(*args):
|
8 |
+
return f"inputs = {*args,}"
|
9 |
+
|
10 |
+
|
11 |
+
with gradio.Blocks() as demo:
|
12 |
+
demo.title = "Faker Classifier"
|
13 |
+
gradio.Markdown("""# Does Faker Win?""")
|
14 |
+
with gradio.Row():
|
15 |
+
# Blue Side
|
16 |
+
with gradio.Column():
|
17 |
+
gradio.Markdown("""## Blue Side""")
|
18 |
+
blue_region = gradio.Dropdown(
|
19 |
+
choices=regions,
|
20 |
+
label="Team's Region",
|
21 |
+
value="Korea",
|
22 |
+
interactive=True,
|
23 |
+
)
|
24 |
+
blue_is_t1 = gradio.Checkbox(label="T1?", value=True)
|
25 |
+
blue_top_champion = gradio.Dropdown(
|
26 |
+
choices=champions,
|
27 |
+
label="Top",
|
28 |
+
value="Teemo",
|
29 |
+
interactive=True,
|
30 |
+
)
|
31 |
+
blue_jungle_champion = gradio.Dropdown(
|
32 |
+
choices=champions,
|
33 |
+
label="Jungle",
|
34 |
+
value="Teemo",
|
35 |
+
interactive=True,
|
36 |
+
)
|
37 |
+
blue_mid_champion = gradio.Dropdown(
|
38 |
+
choices=champions,
|
39 |
+
label="Mid",
|
40 |
+
value="Teemo",
|
41 |
+
interactive=True,
|
42 |
+
)
|
43 |
+
blue_bot_champion = gradio.Dropdown(
|
44 |
+
choices=champions,
|
45 |
+
label="Bot",
|
46 |
+
value="Teemo",
|
47 |
+
interactive=True,
|
48 |
+
)
|
49 |
+
blue_support_champion = gradio.Dropdown(
|
50 |
+
choices=champions,
|
51 |
+
label="Support",
|
52 |
+
value="Teemo",
|
53 |
+
interactive=True,
|
54 |
+
)
|
55 |
+
|
56 |
+
# Red Side
|
57 |
+
with gradio.Column():
|
58 |
+
gradio.Markdown("""## Red Side""")
|
59 |
+
red_region = gradio.Dropdown(
|
60 |
+
choices=regions,
|
61 |
+
label="Team's Region",
|
62 |
+
value="Korea",
|
63 |
+
interactive=True,
|
64 |
+
)
|
65 |
+
red_is_t1 = gradio.Checkbox(label="T1?")
|
66 |
+
red_top_champion = gradio.Dropdown(
|
67 |
+
choices=champions,
|
68 |
+
label="Top",
|
69 |
+
value="Teemo",
|
70 |
+
interactive=True,
|
71 |
+
)
|
72 |
+
red_jungle_champion = gradio.Dropdown(
|
73 |
+
choices=champions,
|
74 |
+
label="Jungle",
|
75 |
+
value="Teemo",
|
76 |
+
interactive=True,
|
77 |
+
)
|
78 |
+
red_mid_champion = gradio.Dropdown(
|
79 |
+
choices=champions,
|
80 |
+
label="Mid",
|
81 |
+
value="Teemo",
|
82 |
+
interactive=True,
|
83 |
+
)
|
84 |
+
red_bot_champion = gradio.Dropdown(
|
85 |
+
choices=champions,
|
86 |
+
label="Bot",
|
87 |
+
value="Teemo",
|
88 |
+
interactive=True,
|
89 |
+
)
|
90 |
+
red_support_champion = gradio.Dropdown(
|
91 |
+
choices=champions,
|
92 |
+
label="Support",
|
93 |
+
value="Teemo",
|
94 |
+
interactive=True,
|
95 |
+
)
|
96 |
+
|
97 |
+
# Listeners
|
98 |
+
red_is_t1.change(
|
99 |
+
fn=lambda is_t1: not is_t1, inputs=red_is_t1, outputs=blue_is_t1
|
100 |
+
)
|
101 |
+
blue_is_t1.change(
|
102 |
+
fn=lambda is_t1: not is_t1, inputs=blue_is_t1, outputs=red_is_t1
|
103 |
+
)
|
104 |
+
red_is_t1.change(
|
105 |
+
fn=lambda is_t1: "Korea" if is_t1 else None,
|
106 |
+
inputs=red_is_t1,
|
107 |
+
outputs=red_region,
|
108 |
+
)
|
109 |
+
blue_is_t1.change(
|
110 |
+
fn=lambda is_t1: "Korea" if is_t1 else None,
|
111 |
+
inputs=blue_is_t1,
|
112 |
+
outputs=blue_region,
|
113 |
+
)
|
114 |
+
gradio.Radio(
|
115 |
+
["Regular Season", "Playoffs", "Gauntlet", "International"],
|
116 |
+
label="Tournament Type",
|
117 |
+
interactive=True,
|
118 |
+
),
|
119 |
+
|
120 |
+
# Output
|
121 |
+
text_output = gradio.Textbox()
|
122 |
+
output_btn = gradio.Button(value="Simulate match")
|
123 |
+
output_btn.click(
|
124 |
+
fn=output,
|
125 |
+
inputs=[
|
126 |
+
blue_is_t1,
|
127 |
+
blue_top_champion,
|
128 |
+
blue_jungle_champion,
|
129 |
+
blue_mid_champion,
|
130 |
+
blue_bot_champion,
|
131 |
+
blue_support_champion,
|
132 |
+
blue_region,
|
133 |
+
red_is_t1,
|
134 |
+
red_top_champion,
|
135 |
+
red_jungle_champion,
|
136 |
+
red_mid_champion,
|
137 |
+
red_bot_champion,
|
138 |
+
red_support_champion,
|
139 |
+
red_region,
|
140 |
+
],
|
141 |
+
outputs=text_output,
|
142 |
+
)
|
143 |
+
# text_button.click(flip_text, inputs=text_input, outputs=text_output)
|
144 |
+
|
145 |
+
|
146 |
+
demo.title = "Does Faker Win?"
|
147 |
+
demo.description = "TODO"
|
148 |
+
if __name__ == "__main__":
|
149 |
+
demo.launch()
|
util/__pycache__/champions.cpython-310.pyc
ADDED
Binary file (1.45 kB). View file
|
|
util/__pycache__/regions.cpython-310.pyc
ADDED
Binary file (260 Bytes). View file
|
|
util/champions.py
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
champions = [
|
2 |
+
"Aatrox",
|
3 |
+
"Ahri",
|
4 |
+
"Akali",
|
5 |
+
"Akshan",
|
6 |
+
"Alistar",
|
7 |
+
"Amumu",
|
8 |
+
"Anivia",
|
9 |
+
"Annie",
|
10 |
+
"Aphelios",
|
11 |
+
"Ashe",
|
12 |
+
"Aurelion Sol",
|
13 |
+
"Azir",
|
14 |
+
"Bard",
|
15 |
+
"Blitzcrank",
|
16 |
+
"Brand",
|
17 |
+
"Braum",
|
18 |
+
"Caitlyn",
|
19 |
+
"Camille",
|
20 |
+
"Cassiopeia",
|
21 |
+
"Cho'Gath",
|
22 |
+
"Corki",
|
23 |
+
"Darius",
|
24 |
+
"Diana",
|
25 |
+
"Dr. Mundo",
|
26 |
+
"Draven",
|
27 |
+
"Ekko",
|
28 |
+
"Elise",
|
29 |
+
"Evelynn",
|
30 |
+
"Ezreal",
|
31 |
+
"Fiddlesticks",
|
32 |
+
"Fiora",
|
33 |
+
"Fizz",
|
34 |
+
"Galio",
|
35 |
+
"Gangplank",
|
36 |
+
"Garen",
|
37 |
+
"Gnar",
|
38 |
+
"Gragas",
|
39 |
+
"Graves",
|
40 |
+
"Gwen",
|
41 |
+
"Hecarim",
|
42 |
+
"Heimerdinger",
|
43 |
+
"Illaoi",
|
44 |
+
"Irelia",
|
45 |
+
"Ivern",
|
46 |
+
"Janna",
|
47 |
+
"Jarvan IV",
|
48 |
+
"Jax",
|
49 |
+
"Jayce",
|
50 |
+
"Jhin",
|
51 |
+
"Jinx",
|
52 |
+
"Kai'Sa",
|
53 |
+
"Kalista",
|
54 |
+
"Karma",
|
55 |
+
"Karthus",
|
56 |
+
"Kassadin",
|
57 |
+
"Katarina",
|
58 |
+
"Kayle",
|
59 |
+
"Kayn",
|
60 |
+
"Kennen",
|
61 |
+
"Kha'Zix",
|
62 |
+
"Kindred",
|
63 |
+
"Kled",
|
64 |
+
"Kog'Maw",
|
65 |
+
"LeBlanc",
|
66 |
+
"Lee Sin",
|
67 |
+
"Leona",
|
68 |
+
"Lillia",
|
69 |
+
"Lissandra",
|
70 |
+
"Lucian",
|
71 |
+
"Lulu",
|
72 |
+
"Lux",
|
73 |
+
"Malphite",
|
74 |
+
"Malzahar",
|
75 |
+
"Maokai",
|
76 |
+
"Master Yi",
|
77 |
+
"Miss Fortune",
|
78 |
+
"Mordekaiser",
|
79 |
+
"Morgana",
|
80 |
+
"Nami",
|
81 |
+
"Nasus",
|
82 |
+
"Nautilus",
|
83 |
+
"Neeko",
|
84 |
+
"Nidalee",
|
85 |
+
"Nocturne",
|
86 |
+
"Nunu",
|
87 |
+
"Olaf",
|
88 |
+
"Orianna",
|
89 |
+
"Ornn",
|
90 |
+
"Pantheon",
|
91 |
+
"Poppy",
|
92 |
+
"Pyke",
|
93 |
+
"Qiyana",
|
94 |
+
"Quinn",
|
95 |
+
"Rakan",
|
96 |
+
"Rammus",
|
97 |
+
"Rek'Sai",
|
98 |
+
"Rell",
|
99 |
+
"Renata Glasc",
|
100 |
+
"Renekton",
|
101 |
+
"Rengar",
|
102 |
+
"Riven",
|
103 |
+
"Rumble",
|
104 |
+
"Ryze",
|
105 |
+
"Samira",
|
106 |
+
"Sejuani",
|
107 |
+
"Senna",
|
108 |
+
"Seraphine",
|
109 |
+
"Sett",
|
110 |
+
"Shaco",
|
111 |
+
"Shen",
|
112 |
+
"Shyvana",
|
113 |
+
"Singed",
|
114 |
+
"Sion",
|
115 |
+
"Sivir",
|
116 |
+
"Skarner",
|
117 |
+
"Sona",
|
118 |
+
"Soraka",
|
119 |
+
"Swain",
|
120 |
+
"Sylas",
|
121 |
+
"Syndra",
|
122 |
+
"Tahm Kench",
|
123 |
+
"Taliyah",
|
124 |
+
"Talon",
|
125 |
+
"Taric",
|
126 |
+
"Teemo",
|
127 |
+
"Thresh",
|
128 |
+
"Tristana",
|
129 |
+
"Trundle",
|
130 |
+
"Tryndamere",
|
131 |
+
"Twisted Fate",
|
132 |
+
"Twitch",
|
133 |
+
"Udyr",
|
134 |
+
"Urgot",
|
135 |
+
"Varus",
|
136 |
+
"Vayne",
|
137 |
+
"Veigar",
|
138 |
+
"Vel'Koz",
|
139 |
+
"Vex",
|
140 |
+
"Vi",
|
141 |
+
"Viego",
|
142 |
+
"Viktor",
|
143 |
+
"Vladimir",
|
144 |
+
"Volibear",
|
145 |
+
"Warwick",
|
146 |
+
"Wukong",
|
147 |
+
"Xayah",
|
148 |
+
"Xerath",
|
149 |
+
"Xin Zhao",
|
150 |
+
"Yasuo",
|
151 |
+
"Yone",
|
152 |
+
"Yorick",
|
153 |
+
"Yuumi",
|
154 |
+
"Zac",
|
155 |
+
"Zed",
|
156 |
+
"Zeri",
|
157 |
+
"Ziggs",
|
158 |
+
"Zilean",
|
159 |
+
"Zoe",
|
160 |
+
"Zyra",
|
161 |
+
]
|
util/regions.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
regions = [
|
2 |
+
"China",
|
3 |
+
"CIS",
|
4 |
+
"Europe",
|
5 |
+
"International",
|
6 |
+
"Japan",
|
7 |
+
"Korea",
|
8 |
+
"LMS",
|
9 |
+
"North America",
|
10 |
+
"PCS",
|
11 |
+
"SEA",
|
12 |
+
"Turkey",
|
13 |
+
"Vietnam",
|
14 |
+
]
|