testing
Browse files
app.py
CHANGED
@@ -258,7 +258,7 @@ async def schedule_restart():
|
|
258 |
Schedule the bot to restart the Hugging Face Space at a specified interval.
|
259 |
For testing purposes, this function restarts the Space every minute.
|
260 |
"""
|
261 |
-
space_id = "Nevaehni/
|
262 |
restart_interval_seconds = 60 # Restart every 60 seconds (1 minute) for testing
|
263 |
|
264 |
while True:
|
@@ -266,7 +266,7 @@ async def schedule_restart():
|
|
266 |
await asyncio.sleep(restart_interval_seconds)
|
267 |
try:
|
268 |
logger.info("Attempting to restart the Hugging Face Space...")
|
269 |
-
hf_api.restart_space(
|
270 |
logger.info("Space restarted successfully.")
|
271 |
except Exception as e:
|
272 |
logger.error(f"Failed to restart space: {e}")
|
|
|
258 |
Schedule the bot to restart the Hugging Face Space at a specified interval.
|
259 |
For testing purposes, this function restarts the Space every minute.
|
260 |
"""
|
261 |
+
space_id = "Nevaehni/DarkMuse" # Replace with your actual space ID
|
262 |
restart_interval_seconds = 60 # Restart every 60 seconds (1 minute) for testing
|
263 |
|
264 |
while True:
|
|
|
266 |
await asyncio.sleep(restart_interval_seconds)
|
267 |
try:
|
268 |
logger.info("Attempting to restart the Hugging Face Space...")
|
269 |
+
hf_api.restart_space(repo_id=space_id, token=HF_TOKEN)
|
270 |
logger.info("Space restarted successfully.")
|
271 |
except Exception as e:
|
272 |
logger.error(f"Failed to restart space: {e}")
|