Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -155,14 +155,29 @@ def rem_save(space,save_state):
|
|
155 |
def toggle_comments_off(r_name,check_list,token):
|
156 |
api = HfApi(token=token)
|
157 |
for ea in check_list:
|
158 |
-
|
159 |
api.change_discussion_status(
|
160 |
repo_id=f'{r_name}/{ea}',
|
161 |
new_status='closed',
|
162 |
token=token,
|
163 |
repo_type='space',
|
164 |
)
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
with gr.Blocks(css=css) as build:
|
167 |
save_state=gr.State()
|
168 |
space_list=gr.State([])
|
|
|
155 |
def toggle_comments_off(r_name,check_list,token):
|
156 |
api = HfApi(token=token)
|
157 |
for ea in check_list:
|
|
|
158 |
api.change_discussion_status(
|
159 |
repo_id=f'{r_name}/{ea}',
|
160 |
new_status='closed',
|
161 |
token=token,
|
162 |
repo_type='space',
|
163 |
)
|
164 |
+
def set_space_sleep_time(r_name,check_list,sleep_time,token):
|
165 |
+
api = HfApi(token=token)
|
166 |
+
for ea in check_list:
|
167 |
+
api.set_space_sleep_time(
|
168 |
+
repo_id=f'{r_name}/{ea}',
|
169 |
+
sleep_time=sleep_time,
|
170 |
+
token=token,
|
171 |
+
)
|
172 |
+
|
173 |
+
def set_space_visible(r_name,check_list,private_bool,token):
|
174 |
+
api = HfApi(token=token)
|
175 |
+
for ea in check_list:
|
176 |
+
api.update_repo_visibility(
|
177 |
+
repo_id=f'{r_name}/{ea}',
|
178 |
+
private=private_bool,
|
179 |
+
token=token,
|
180 |
+
)
|
181 |
with gr.Blocks(css=css) as build:
|
182 |
save_state=gr.State()
|
183 |
space_list=gr.State([])
|