Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
import streamlit as st
|
2 |
-
from PIL import Image
|
3 |
-
from components import GamePlay, Player, Dealer, Deck
|
4 |
-
|
5 |
-
# PersistDataset -----
|
6 |
import os
|
7 |
import csv
|
8 |
-
|
9 |
import huggingface_hub
|
|
|
|
|
|
|
10 |
from huggingface_hub import Repository, hf_hub_download, upload_file
|
11 |
from datetime import datetime
|
12 |
|
@@ -15,7 +13,8 @@ DATASET_REPO_ID = "awacke1/Carddata.csv"
|
|
15 |
DATA_FILENAME = "Carddata.csv"
|
16 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
17 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
18 |
-
|
|
|
19 |
|
20 |
def generate_html() -> str:
|
21 |
with open(DATA_FILE) as csvfile:
|
@@ -45,10 +44,6 @@ def store_message(name: str, message: str):
|
|
45 |
)
|
46 |
commit_url = repo.push_to_hub()
|
47 |
return generate_html()
|
48 |
-
|
49 |
-
# Game settings
|
50 |
-
number_of_decks = 6
|
51 |
-
blackjack_multiplier = 1.5
|
52 |
|
53 |
# Initialize player, dealer, deck and game play. Cache these variables
|
54 |
@st.cache(allow_output_mutation=True, suppress_st_warning=True)
|
@@ -59,8 +54,14 @@ def start_game():
|
|
59 |
game_play = GamePlay(player, dealer, game_deck, blackjack_multiplier)
|
60 |
return game_deck, dealer, player, game_play
|
61 |
|
|
|
|
|
|
|
62 |
game_deck, dealer, player, game_play = start_game()
|
63 |
|
|
|
|
|
|
|
64 |
st.title('🃏Blackjack Simulator AI♠2️⃣1️⃣')
|
65 |
|
66 |
if st.button('New hand?'):
|
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
2 |
import os
|
3 |
import csv
|
|
|
4 |
import huggingface_hub
|
5 |
+
|
6 |
+
from PIL import Image
|
7 |
+
from components import GamePlay, Player, Dealer, Deck
|
8 |
from huggingface_hub import Repository, hf_hub_download, upload_file
|
9 |
from datetime import datetime
|
10 |
|
|
|
13 |
DATA_FILENAME = "Carddata.csv"
|
14 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
15 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
16 |
+
number_of_decks = 6
|
17 |
+
blackjack_multiplier = 1.5
|
18 |
|
19 |
def generate_html() -> str:
|
20 |
with open(DATA_FILE) as csvfile:
|
|
|
44 |
)
|
45 |
commit_url = repo.push_to_hub()
|
46 |
return generate_html()
|
|
|
|
|
|
|
|
|
47 |
|
48 |
# Initialize player, dealer, deck and game play. Cache these variables
|
49 |
@st.cache(allow_output_mutation=True, suppress_st_warning=True)
|
|
|
54 |
game_play = GamePlay(player, dealer, game_deck, blackjack_multiplier)
|
55 |
return game_deck, dealer, player, game_play
|
56 |
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
game_deck, dealer, player, game_play = start_game()
|
61 |
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
st.title('🃏Blackjack Simulator AI♠2️⃣1️⃣')
|
66 |
|
67 |
if st.button('New hand?'):
|