Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -60,12 +60,13 @@ class UNetWrapper:
|
|
60 |
def __init__(self, unet_model, repo_id):
|
61 |
self.model = unet_model
|
62 |
self.repo_id = repo_id
|
|
|
63 |
|
64 |
def push_to_hub(self):
|
65 |
# Initialize the Hugging Face API
|
66 |
api = HfApi()
|
67 |
# Create a repository if it doesn't exist
|
68 |
-
create_repo(self.repo_id, exist_ok=True)
|
69 |
# Push the model's state dict to the Hugging Face Hub
|
70 |
self.model.save_pretrained(self.repo_id) # You may need to implement this method
|
71 |
|
|
|
60 |
def __init__(self, unet_model, repo_id):
|
61 |
self.model = unet_model
|
62 |
self.repo_id = repo_id
|
63 |
+
self.token = os.getenv('HF_WRITE')
|
64 |
|
65 |
def push_to_hub(self):
|
66 |
# Initialize the Hugging Face API
|
67 |
api = HfApi()
|
68 |
# Create a repository if it doesn't exist
|
69 |
+
create_repo(self.repo_id, exist_ok=True,token=self.token)
|
70 |
# Push the model's state dict to the Hugging Face Hub
|
71 |
self.model.save_pretrained(self.repo_id) # You may need to implement this method
|
72 |
|