Shiyu Zhao commited on
Commit
bb3ddcf
1 Parent(s): b554584

Update space

Browse files
Files changed (1) hide show
  1. utils/hub_storage.py +2 -4
utils/hub_storage.py CHANGED
@@ -3,6 +3,7 @@ from huggingface_hub import HfApi
3
  from .token_handler import TokenHandler
4
  import time
5
  import tempfile
 
6
 
7
  class HubStorage:
8
  def __init__(self, repo_id):
@@ -45,10 +46,7 @@ class HubStorage:
45
  repo_type="space",
46
  commit_message=commit_message
47
  )
48
-
49
- # Clean up temporary file if we created one
50
- if isinstance(file_content, str):
51
- os.unlink(temp_path)
52
 
53
  return True
54
  except Exception as e:
 
3
  from .token_handler import TokenHandler
4
  import time
5
  import tempfile
6
+ import os
7
 
8
  class HubStorage:
9
  def __init__(self, repo_id):
 
46
  repo_type="space",
47
  commit_message=commit_message
48
  )
49
+ os.unlink(temp_path)
 
 
 
50
 
51
  return True
52
  except Exception as e: