Omnibus commited on
Commit
1b8f2ad
1 Parent(s): cd28cca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -20,9 +20,9 @@ token_self = os.environ['HF_TOKEN']
20
  api=HfApi(token=token_self)
21
 
22
  sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
23
- platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
24
  star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
25
  bomb = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/bomb.png'
 
26
  dude = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/dude.png'
27
 
28
  get_window_url_params = """
@@ -153,10 +153,10 @@ def save_game(name,score):
153
  print (e)
154
  pass
155
  try:
156
- platform_out=Image.open(platform)
157
- platform_out.save(f"{uid}_platform.png")
158
  api.upload_file(
159
- path_or_fileobj=f"{uid}_platform.png",
160
  path_in_repo=f"{save_data.split('main/',1)[1]}/images/platform/{game}-platform_img.png",
161
  repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
162
  token=token_self,
@@ -170,7 +170,7 @@ def save_game(name,score):
170
  dude_out.save(f"{uid}_dude.png")
171
 
172
  api.upload_file(
173
- path_or_fileobj=f"{uid}_dude.png",
174
  path_in_repo=f"{save_data.split('main/',1)[1]}/images/dude/{game}-dude_img.png",
175
  repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
176
  token=token_self,
 
20
  api=HfApi(token=token_self)
21
 
22
  sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
 
23
  star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
24
  bomb = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/bomb.png'
25
+ platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
26
  dude = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/dude.png'
27
 
28
  get_window_url_params = """
 
153
  print (e)
154
  pass
155
  try:
156
+ #platform_out=Image.open(platform)
157
+ #platform_out.save(f"{uid}_platform.png")
158
  api.upload_file(
159
+ path_or_fileobj="assets/platform.png",
160
  path_in_repo=f"{save_data.split('main/',1)[1]}/images/platform/{game}-platform_img.png",
161
  repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
162
  token=token_self,
 
170
  dude_out.save(f"{uid}_dude.png")
171
 
172
  api.upload_file(
173
+ path_or_fileobj="assets/dude.png",
174
  path_in_repo=f"{save_data.split('main/',1)[1]}/images/dude/{game}-dude_img.png",
175
  repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
176
  token=token_self,