Omnibus commited on
Commit
1fbcc7d
1 Parent(s): 891fd88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -7,12 +7,14 @@ import random
7
  import bg
8
  from rembg import remove as rm
9
  import datetime
 
 
10
  proc1=diff
11
  proc2=diff
12
 
13
  save_data='https://huggingface.co/datasets/Omnibus/game-data-1/raw/main/'
14
  token_self = os.environ['HF_TOKEN']
15
-
16
  #bg1=gr.Interface.load("spaces/Omnibus/fast-bg-remove-mod")
17
  #proc2=gr.Interface.load("spaces/Omnibus/fast-diff")
18
 
@@ -97,8 +99,7 @@ def save_game(background_img,star_img,enemy_img,platform_img,dude_img):
97
  #enemy_img.save(f"{uid}-enemy_img.png")
98
  #platform_img.save(f"{uid}-platform_img.png")
99
  #dude_img.save(f"{uid}-dude_img.png")
100
-
101
- user_repo=game_data.split('datasets/',1)[1].split('/raw',1)[0]
102
  try:
103
  r = requests.get(f'{save_data}/game_data.json')
104
  lod = json.loads(r.text)
 
7
  import bg
8
  from rembg import remove as rm
9
  import datetime
10
+ from huggingface_hub import (HfApi)
11
+
12
  proc1=diff
13
  proc2=diff
14
 
15
  save_data='https://huggingface.co/datasets/Omnibus/game-data-1/raw/main/'
16
  token_self = os.environ['HF_TOKEN']
17
+ api=HfApi(token=token_self)
18
  #bg1=gr.Interface.load("spaces/Omnibus/fast-bg-remove-mod")
19
  #proc2=gr.Interface.load("spaces/Omnibus/fast-diff")
20
 
 
99
  #enemy_img.save(f"{uid}-enemy_img.png")
100
  #platform_img.save(f"{uid}-platform_img.png")
101
  #dude_img.save(f"{uid}-dude_img.png")
102
+ user_repo=save_data.split('datasets/',1)[1].split('/raw',1)[0]
 
103
  try:
104
  r = requests.get(f'{save_data}/game_data.json')
105
  lod = json.loads(r.text)