Spaces:
Sleeping
Sleeping
Timo
commited on
Commit
·
6dadf8f
1
Parent(s):
8ef1a8f
Works now
Browse files- src/streamlit_app.py +38 -3
src/streamlit_app.py
CHANGED
|
@@ -162,7 +162,7 @@ with st.sidebar:
|
|
| 162 |
|
| 163 |
# -------- Main content organised in tabs ------------------------------------
|
| 164 |
|
| 165 |
-
tabs = st.tabs(["Draft", "P1P1 Rankings"])
|
| 166 |
|
| 167 |
def add_card(target: str, card: str):
|
| 168 |
"""target is 'pack' or 'picks'."""
|
|
@@ -202,7 +202,9 @@ def undo_last():
|
|
| 202 |
|
| 203 |
# --- Tab 1: Draft -------------------------------------------------------
|
| 204 |
with tabs[0]:
|
| 205 |
-
|
|
|
|
|
|
|
| 206 |
if st.session_state["undo_stack"]:
|
| 207 |
st.button("↩️ Undo last action", on_click=undo_last)
|
| 208 |
|
|
@@ -316,4 +318,37 @@ with tabs[1]:
|
|
| 316 |
except Exception as e:
|
| 317 |
st.error(f"Could not calculate P1P1: {e}")
|
| 318 |
else:
|
| 319 |
-
st.info("Select a set in the sidebar to view P1P1.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
# -------- Main content organised in tabs ------------------------------------
|
| 164 |
|
| 165 |
+
tabs = st.tabs(["Draft", "P1P1 Rankings", "Instructions"])
|
| 166 |
|
| 167 |
def add_card(target: str, card: str):
|
| 168 |
"""target is 'pack' or 'picks'."""
|
|
|
|
| 202 |
|
| 203 |
# --- Tab 1: Draft -------------------------------------------------------
|
| 204 |
with tabs[0]:
|
| 205 |
+
if st.session_state.get("set_code") == "EOE":
|
| 206 |
+
st.warning("The model is not trained for this set. Results may be inaccurate.", icon="⚠️")
|
| 207 |
+
|
| 208 |
if st.session_state["undo_stack"]:
|
| 209 |
st.button("↩️ Undo last action", on_click=undo_last)
|
| 210 |
|
|
|
|
| 318 |
except Exception as e:
|
| 319 |
st.error(f"Could not calculate P1P1: {e}")
|
| 320 |
else:
|
| 321 |
+
st.info("Select a set in the sidebar to view P1P1.")
|
| 322 |
+
|
| 323 |
+
with tabs[2]:
|
| 324 |
+
st.header("📖 How to Use MTG Draft Assistant")
|
| 325 |
+
|
| 326 |
+
st.markdown("""
|
| 327 |
+
Welcome to the **MTG Draft Assistant**!
|
| 328 |
+
This tool helps you evaluate booster packs and draft the best cards.
|
| 329 |
+
|
| 330 |
+
### Steps
|
| 331 |
+
1. **Choose your set** from the sidebar.
|
| 332 |
+
2. **Add cards** to your pack using the search bar on the right.
|
| 333 |
+
3. The model will score the cards and suggest the best pick.
|
| 334 |
+
4. Click **Pick** to move a card from your pack to your deck.
|
| 335 |
+
5. Repeat until your deck is complete.
|
| 336 |
+
|
| 337 |
+
### Important Notes
|
| 338 |
+
The model uses data from 17Lands to score cards based drafts from other players.
|
| 339 |
+
Although it is able to make predictions for all cards, data for the most recent set is sometimes
|
| 340 |
+
not available, harming the model's performance.
|
| 341 |
+
|
| 342 |
+
Currently, the model **only** uses how cards are picked, not how they perform in games.
|
| 343 |
+
This leads to some cards being evaluated differently, if players pick them highly.
|
| 344 |
+
For example, we find that the current model has a bias towards Rares and Mythics, which look splashy.
|
| 345 |
+
As the next step, we will filter data based on player and draft performance.
|
| 346 |
+
|
| 347 |
+
We currently also do not support special guest cards, although these will be added soon.
|
| 348 |
+
|
| 349 |
+
|
| 350 |
+
### Tips
|
| 351 |
+
- Hover over a score bar to see the exact value.
|
| 352 |
+
|
| 353 |
+
---
|
| 354 |
+
""")
|