Update app.py
Browse files
app.py
CHANGED
@@ -153,8 +153,9 @@ def save_game(name,score):
|
|
153 |
print (e)
|
154 |
pass
|
155 |
try:
|
|
|
156 |
api.upload_file(
|
157 |
-
path_or_fileobj=
|
158 |
path_in_repo=f"{save_data.split('main/',1)[1]}/images/platform/{game}-platform_img.png",
|
159 |
repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
|
160 |
token=token_self,
|
@@ -164,8 +165,10 @@ def save_game(name,score):
|
|
164 |
print (e)
|
165 |
pass
|
166 |
try:
|
|
|
|
|
167 |
api.upload_file(
|
168 |
-
path_or_fileobj=
|
169 |
path_in_repo=f"{save_data.split('main/',1)[1]}/images/enemy/{game}-dude_img.png",
|
170 |
repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
|
171 |
token=token_self,
|
@@ -181,8 +184,8 @@ def save_game(name,score):
|
|
181 |
'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
|
182 |
'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
|
183 |
'enemy_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/enemy/{game}-enemy_img.png',
|
184 |
-
'platform_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/
|
185 |
-
'dude_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/
|
186 |
}
|
187 |
print(block)
|
188 |
lod.append(block)
|
@@ -210,8 +213,8 @@ def save_game(name,score):
|
|
210 |
'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
|
211 |
'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
|
212 |
'enemy_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/enemy/{game}-enemy_img.png',
|
213 |
-
'platform_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/
|
214 |
-
'dude_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/
|
215 |
}
|
216 |
print(block)
|
217 |
game_box.append(block2)
|
|
|
153 |
print (e)
|
154 |
pass
|
155 |
try:
|
156 |
+
platform.save(f"{uid}_platform.png")
|
157 |
api.upload_file(
|
158 |
+
path_or_fileobj=f"{uid}_platform.png",
|
159 |
path_in_repo=f"{save_data.split('main/',1)[1]}/images/platform/{game}-platform_img.png",
|
160 |
repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
|
161 |
token=token_self,
|
|
|
165 |
print (e)
|
166 |
pass
|
167 |
try:
|
168 |
+
dude.save(f"{uid}_dude.png")
|
169 |
+
|
170 |
api.upload_file(
|
171 |
+
path_or_fileobj=f"{uid}_dude.png",
|
172 |
path_in_repo=f"{save_data.split('main/',1)[1]}/images/enemy/{game}-dude_img.png",
|
173 |
repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
|
174 |
token=token_self,
|
|
|
184 |
'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
|
185 |
'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
|
186 |
'enemy_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/enemy/{game}-enemy_img.png',
|
187 |
+
'platform_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/platform/{game}-platform_img.png',
|
188 |
+
'dude_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/dude/{game}-dude_img.png',
|
189 |
}
|
190 |
print(block)
|
191 |
lod.append(block)
|
|
|
213 |
'background_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/background/{game}-background_img.png',
|
214 |
'star_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/star/{game}-star_img.png',
|
215 |
'enemy_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/enemy/{game}-enemy_img.png',
|
216 |
+
'platform_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/platform/{game}-platform_img.png',
|
217 |
+
'dude_url': f'https://huggingface.co/datasets/{user_repo}/resolve/main/images/dude/{game}-dude_img.png',
|
218 |
}
|
219 |
print(block)
|
220 |
game_box.append(block2)
|