Spaces:
Running
Running
Update webui.ipynb
Browse files- webui.ipynb +295 -19
webui.ipynb
CHANGED
@@ -7,13 +7,19 @@
|
|
7 |
"colab_type": "text"
|
8 |
},
|
9 |
"source": [
|
10 |
-
"<a href=\"https://colab.research.google.com/github/TheNeodev/
|
11 |
]
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "markdown",
|
15 |
"source": [
|
16 |
-
"# RVC
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
],
|
18 |
"metadata": {
|
19 |
"id": "vOlZ8mQ0XMpC"
|
@@ -22,6 +28,13 @@
|
|
22 |
{
|
23 |
"cell_type": "markdown",
|
24 |
"source": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
"**This project was created by [TheNeoDev](https://github.com/TheNeodev)** base on [PhamHuynhAnh16/Vietnamese-RVC](https://github.com/PhamHuynhAnh16/Vietnamese-RVC)\n",
|
26 |
"\n",
|
27 |
"---"
|
@@ -32,28 +45,43 @@
|
|
32 |
},
|
33 |
{
|
34 |
"cell_type": "markdown",
|
35 |
-
"metadata": {
|
36 |
-
"id": "LVAACnvlmE4I"
|
37 |
-
},
|
38 |
"source": [
|
|
|
39 |
"\n",
|
|
|
40 |
"\n",
|
41 |
-
"
|
42 |
"\n",
|
43 |
-
"
|
44 |
-
|
45 |
-
|
|
|
|
|
46 |
},
|
47 |
{
|
48 |
"cell_type": "code",
|
49 |
-
"execution_count":
|
50 |
"metadata": {
|
51 |
"cellView": "form",
|
52 |
-
"id": "BJeRif5jjL5s"
|
|
|
|
|
|
|
|
|
53 |
},
|
54 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
"source": [
|
56 |
-
"
|
|
|
|
|
57 |
"\n",
|
58 |
"import os\n",
|
59 |
"from ipywidgets import Button\n",
|
@@ -62,13 +90,15 @@
|
|
62 |
"\n",
|
63 |
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
|
64 |
"\n",
|
65 |
-
"!git clone https://github.com/unchCrew/RVC-MAKER.git /content/
|
66 |
-
"!pip install -r /content/
|
67 |
-
"!pip install pyngrok
|
|
|
|
|
68 |
"\n",
|
69 |
"#@markdown **💻 Installation will take about 2 minutes to complete!**\n",
|
70 |
"clear_output()\n",
|
71 |
-
"
|
72 |
]
|
73 |
},
|
74 |
{
|
@@ -84,7 +114,7 @@
|
|
84 |
"import os\n",
|
85 |
"import shutil\n",
|
86 |
"\n",
|
87 |
-
"%cd /content/
|
88 |
"#@markdown **To experience all the features, use the interface :)**\n",
|
89 |
"\n",
|
90 |
"#@markdown **If you know you can use the tensorboard to check for overtraining 👍**\n",
|
@@ -160,6 +190,13 @@
|
|
160 |
" %load_ext tensorboard\n",
|
161 |
" %tensorboard --logdir ./assets/logs --port=6870\n",
|
162 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
"\n",
|
164 |
"thread_app = threading.Thread(target=start_app)\n",
|
165 |
"thread_app.start()\n",
|
@@ -172,12 +209,251 @@
|
|
172 |
{
|
173 |
"cell_type": "markdown",
|
174 |
"source": [
|
175 |
-
"# Extra"
|
|
|
|
|
176 |
],
|
177 |
"metadata": {
|
178 |
"id": "OVg-SqBKXIFL"
|
179 |
}
|
180 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
{
|
182 |
"cell_type": "code",
|
183 |
"source": [
|
|
|
7 |
"colab_type": "text"
|
8 |
},
|
9 |
"source": [
|
10 |
+
"<a href=\"https://colab.research.google.com/github/TheNeodev/Notebook/blob/main/RVC-MAKER.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
11 |
]
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "markdown",
|
15 |
"source": [
|
16 |
+
"# <h1 align=\"center\"><b> Ultimate RVC Maker 🎵 </b></h1>\n",
|
17 |
+
"<div align=\"center\">\n",
|
18 |
+
"\n",
|
19 |
+
"\n",
|
20 |
+
"\n",
|
21 |
+
"\n",
|
22 |
+
"an high-quality voice conversion tool focused on experimenting and performance, based on Vietnamese-RVC (which is an RVC Fork)."
|
23 |
],
|
24 |
"metadata": {
|
25 |
"id": "vOlZ8mQ0XMpC"
|
|
|
28 |
{
|
29 |
"cell_type": "markdown",
|
30 |
"source": [
|
31 |
+
"<div align=\"center\">\n",
|
32 |
+
"\n",
|
33 |
+
"_____________________________________________________________\n",
|
34 |
+
"[support](https://discord.gg/aihub) | [github](https://github.com/unchCrew/RVC-MAKER.git) | [Terms of Use](https://github.com/unchCrew/RVC-MAKER/blob/main/TERMS_OF_USE.md)\n",
|
35 |
+
"_____________________________________________________________\n",
|
36 |
+
"\n",
|
37 |
+
"\n",
|
38 |
"**This project was created by [TheNeoDev](https://github.com/TheNeodev)** base on [PhamHuynhAnh16/Vietnamese-RVC](https://github.com/PhamHuynhAnh16/Vietnamese-RVC)\n",
|
39 |
"\n",
|
40 |
"---"
|
|
|
45 |
},
|
46 |
{
|
47 |
"cell_type": "markdown",
|
|
|
|
|
|
|
48 |
"source": [
|
49 |
+
"**Acknowledgments**\n",
|
50 |
"\n",
|
51 |
+
"To all external collaborators for their special help in the following areas: Original RVC / Mainline (for making RVC), Vietnamese-RVC (for their up to date Fork used as a Base),\n",
|
52 |
"\n",
|
53 |
+
"**Disclaimer**\n",
|
54 |
"\n",
|
55 |
+
"By using Ultimate RVC Maker, you agree to comply with ethical and legal standards, respect intellectual property and privacy rights, avoid harmful or prohibited uses, and accept full responsibility for any outcomes, while Ultimate RVC Maker disclaims liability and reserves the right to amend these terms."
|
56 |
+
],
|
57 |
+
"metadata": {
|
58 |
+
"id": "4-h9Eo-IwDBG"
|
59 |
+
}
|
60 |
},
|
61 |
{
|
62 |
"cell_type": "code",
|
63 |
+
"execution_count": 1,
|
64 |
"metadata": {
|
65 |
"cellView": "form",
|
66 |
+
"id": "BJeRif5jjL5s",
|
67 |
+
"outputId": "341804d9-18e0-4e88-e59c-a86e69ecedb3",
|
68 |
+
"colab": {
|
69 |
+
"base_uri": "https://localhost:8080/"
|
70 |
+
}
|
71 |
},
|
72 |
+
"outputs": [
|
73 |
+
{
|
74 |
+
"output_type": "stream",
|
75 |
+
"name": "stdout",
|
76 |
+
"text": [
|
77 |
+
"✅ Finished installing requirements!\n"
|
78 |
+
]
|
79 |
+
}
|
80 |
+
],
|
81 |
"source": [
|
82 |
+
"\n",
|
83 |
+
"\n",
|
84 |
+
" #@title **INSTALL ULTIMATE RVC MAKER!**\n",
|
85 |
"\n",
|
86 |
"import os\n",
|
87 |
"from ipywidgets import Button\n",
|
|
|
90 |
"\n",
|
91 |
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
|
92 |
"\n",
|
93 |
+
"!git clone https://github.com/unchCrew/RVC-MAKER.git /content/program > /dev/null 2>&1\n",
|
94 |
+
"!pip install -r /content/program/requirements.txt > /dev/null 2>&1\n",
|
95 |
+
"!pip install pyngrok > /dev/null 2>&1\n",
|
96 |
+
"!uv pip install --index-url https://download.pytorch.org/whl/cu128 > /dev/null 2>&1\n",
|
97 |
+
"\n",
|
98 |
"\n",
|
99 |
"#@markdown **💻 Installation will take about 2 minutes to complete!**\n",
|
100 |
"clear_output()\n",
|
101 |
+
"print(\"✅ Finished installing requirements!\")"
|
102 |
]
|
103 |
},
|
104 |
{
|
|
|
114 |
"import os\n",
|
115 |
"import shutil\n",
|
116 |
"\n",
|
117 |
+
"%cd /content/program\n",
|
118 |
"#@markdown **To experience all the features, use the interface :)**\n",
|
119 |
"\n",
|
120 |
"#@markdown **If you know you can use the tensorboard to check for overtraining 👍**\n",
|
|
|
190 |
" %load_ext tensorboard\n",
|
191 |
" %tensorboard --logdir ./assets/logs --port=6870\n",
|
192 |
"\n",
|
193 |
+
"if \"autobackups\" not in globals():\n",
|
194 |
+
" autobackups = False\n",
|
195 |
+
"\n",
|
196 |
+
"if autobackups:\n",
|
197 |
+
" thread = threading.Thread(target=backup_files)\n",
|
198 |
+
" thread.start()\n",
|
199 |
+
"\n",
|
200 |
"\n",
|
201 |
"thread_app = threading.Thread(target=start_app)\n",
|
202 |
"thread_app.start()\n",
|
|
|
209 |
{
|
210 |
"cell_type": "markdown",
|
211 |
"source": [
|
212 |
+
"# Extra\n",
|
213 |
+
"\n",
|
214 |
+
"Enjoy extra options that can make it easier for you to use Ultimate RVC Maker"
|
215 |
],
|
216 |
"metadata": {
|
217 |
"id": "OVg-SqBKXIFL"
|
218 |
}
|
219 |
},
|
220 |
+
{
|
221 |
+
"cell_type": "code",
|
222 |
+
"source": [
|
223 |
+
"# @title Mount Drive\n",
|
224 |
+
"# @markdown Mount the files from Google Drive to the Colab.\n",
|
225 |
+
"from google.colab import drive\n",
|
226 |
+
"\n",
|
227 |
+
"drive.mount(\"/content/drive\")"
|
228 |
+
],
|
229 |
+
"metadata": {
|
230 |
+
"cellView": "form",
|
231 |
+
"id": "iVmOpUn2xhe_"
|
232 |
+
},
|
233 |
+
"execution_count": null,
|
234 |
+
"outputs": []
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"cell_type": "code",
|
238 |
+
"source": [
|
239 |
+
"# @title Auto Backup\n",
|
240 |
+
"# @markdown When running it, it will be activated or deactivated previously to start up together with RVC Maker.\n",
|
241 |
+
"import os\n",
|
242 |
+
"import shutil\n",
|
243 |
+
"import time\n",
|
244 |
+
"\n",
|
245 |
+
"LOGS_FOLDER = \"/content/program/assets/logs/\"\n",
|
246 |
+
"GOOGLE_DRIVE_PATH = \"/content/drive/MyDrive/RVCBackup\"\n",
|
247 |
+
"\n",
|
248 |
+
"if \"autobackups\" not in globals():\n",
|
249 |
+
" autobackups = False\n",
|
250 |
+
"\n",
|
251 |
+
"cooldown = 15 # @param {type:\"slider\", min:0, max:100, step:0}\n",
|
252 |
+
"def backup_files():\n",
|
253 |
+
" print(\"\\nStarting backup loop...\")\n",
|
254 |
+
" last_backup_timestamps_path = os.path.join(\n",
|
255 |
+
" LOGS_FOLDER, \"last_backup_timestamps.txt\"\n",
|
256 |
+
" )\n",
|
257 |
+
" fully_updated = False\n",
|
258 |
+
"\n",
|
259 |
+
" while True:\n",
|
260 |
+
" try:\n",
|
261 |
+
" updated_files = 0\n",
|
262 |
+
" deleted_files = 0\n",
|
263 |
+
" new_files = 0\n",
|
264 |
+
" last_backup_timestamps = {}\n",
|
265 |
+
"\n",
|
266 |
+
" try:\n",
|
267 |
+
" with open(last_backup_timestamps_path, \"r\") as f:\n",
|
268 |
+
" last_backup_timestamps = dict(line.strip().split(\":\") for line in f)\n",
|
269 |
+
" except FileNotFoundError:\n",
|
270 |
+
" pass\n",
|
271 |
+
"\n",
|
272 |
+
" for root, dirs, files in os.walk(LOGS_FOLDER):\n",
|
273 |
+
" # Excluding \"zips\" and \"mute\" directories\n",
|
274 |
+
" if \"zips\" in dirs:\n",
|
275 |
+
" dirs.remove(\"zips\")\n",
|
276 |
+
" if \"mute\" in dirs:\n",
|
277 |
+
" dirs.remove(\"mute\")\n",
|
278 |
+
"\n",
|
279 |
+
" for filename in files:\n",
|
280 |
+
" if filename != \"last_backup_timestamps.txt\":\n",
|
281 |
+
" filepath = os.path.join(root, filename)\n",
|
282 |
+
" if os.path.isfile(filepath):\n",
|
283 |
+
" backup_filepath = os.path.join(\n",
|
284 |
+
" GOOGLE_DRIVE_PATH,\n",
|
285 |
+
" os.path.relpath(filepath, LOGS_FOLDER),\n",
|
286 |
+
" )\n",
|
287 |
+
" backup_folderpath = os.path.dirname(backup_filepath)\n",
|
288 |
+
" if not os.path.exists(backup_folderpath):\n",
|
289 |
+
" os.makedirs(backup_folderpath)\n",
|
290 |
+
" last_backup_timestamp = last_backup_timestamps.get(filepath)\n",
|
291 |
+
" current_timestamp = os.path.getmtime(filepath)\n",
|
292 |
+
" if (\n",
|
293 |
+
" last_backup_timestamp is None\n",
|
294 |
+
" or float(last_backup_timestamp) < current_timestamp\n",
|
295 |
+
" ):\n",
|
296 |
+
" shutil.copy2(filepath, backup_filepath)\n",
|
297 |
+
" last_backup_timestamps[filepath] = str(current_timestamp)\n",
|
298 |
+
" if last_backup_timestamp is None:\n",
|
299 |
+
" new_files += 1\n",
|
300 |
+
" else:\n",
|
301 |
+
" updated_files += 1\n",
|
302 |
+
"\n",
|
303 |
+
"\n",
|
304 |
+
" for filepath in list(last_backup_timestamps.keys()):\n",
|
305 |
+
" if not os.path.exists(filepath):\n",
|
306 |
+
" backup_filepath = os.path.join(\n",
|
307 |
+
" GOOGLE_DRIVE_PATH, os.path.relpath(filepath, LOGS_FOLDER)\n",
|
308 |
+
" )\n",
|
309 |
+
" if os.path.exists(backup_filepath):\n",
|
310 |
+
" os.remove(backup_filepath)\n",
|
311 |
+
" deleted_files += 1\n",
|
312 |
+
" del last_backup_timestamps[filepath]\n",
|
313 |
+
"\n",
|
314 |
+
"\n",
|
315 |
+
" if updated_files > 0 or deleted_files > 0 or new_files > 0:\n",
|
316 |
+
" print(f\"Backup Complete: {new_files} new, {updated_files} updated, {deleted_files} deleted.\")\n",
|
317 |
+
" fully_updated = False\n",
|
318 |
+
" elif not fully_updated:\n",
|
319 |
+
" print(\"Files are up to date.\")\n",
|
320 |
+
" fully_updated = True\n",
|
321 |
+
"\n",
|
322 |
+
" with open(last_backup_timestamps_path, \"w\") as f:\n",
|
323 |
+
" for filepath, timestamp in last_backup_timestamps.items():\n",
|
324 |
+
" f.write(f\"{filepath}:{timestamp}\\n\")\n",
|
325 |
+
"\n",
|
326 |
+
" time.sleep(cooldown if fully_updated else 0.1)\n",
|
327 |
+
"\n",
|
328 |
+
"\n",
|
329 |
+
" except Exception as error:\n",
|
330 |
+
" print(f\"An error occurred during backup: {error}\")\n",
|
331 |
+
"\n",
|
332 |
+
"\n",
|
333 |
+
"if autobackups:\n",
|
334 |
+
" autobackups = False\n",
|
335 |
+
" print(\"Autobackup Disabled\")\n",
|
336 |
+
"else:\n",
|
337 |
+
" autobackups = True\n",
|
338 |
+
" print(\"Autobackup Enabled\")"
|
339 |
+
],
|
340 |
+
"metadata": {
|
341 |
+
"cellView": "form",
|
342 |
+
"id": "7PoT_1qCxlLZ"
|
343 |
+
},
|
344 |
+
"execution_count": null,
|
345 |
+
"outputs": []
|
346 |
+
},
|
347 |
+
{
|
348 |
+
"cell_type": "code",
|
349 |
+
"source": [
|
350 |
+
"# @title Auto Backup\n",
|
351 |
+
"# @markdown When running it, it will be activated or deactivated previously to start up together with Applio.\n",
|
352 |
+
"import os\n",
|
353 |
+
"import shutil\n",
|
354 |
+
"import time\n",
|
355 |
+
"\n",
|
356 |
+
"LOGS_FOLDER = \"/content/program/assets/logs/\"\n",
|
357 |
+
"GOOGLE_DRIVE_PATH = \"/content/drive/MyDrive/RVCBackup\"\n",
|
358 |
+
"if \"autobackups\" not in globals():\n",
|
359 |
+
" autobackups = False\n",
|
360 |
+
"\n",
|
361 |
+
"cooldown = 15 # @param {type:\"slider\", min:0, max:100, step:0}\n",
|
362 |
+
"def backup_files():\n",
|
363 |
+
" print(\"\\nStarting backup loop...\")\n",
|
364 |
+
" last_backup_timestamps_path = os.path.join(\n",
|
365 |
+
" LOGS_FOLDER, \"last_backup_timestamps.txt\"\n",
|
366 |
+
" )\n",
|
367 |
+
" fully_updated = False\n",
|
368 |
+
"\n",
|
369 |
+
" while True:\n",
|
370 |
+
" try:\n",
|
371 |
+
" updated_files = 0\n",
|
372 |
+
" deleted_files = 0\n",
|
373 |
+
" new_files = 0\n",
|
374 |
+
" last_backup_timestamps = {}\n",
|
375 |
+
"\n",
|
376 |
+
" try:\n",
|
377 |
+
" with open(last_backup_timestamps_path, \"r\") as f:\n",
|
378 |
+
" last_backup_timestamps = dict(line.strip().split(\":\") for line in f)\n",
|
379 |
+
" except FileNotFoundError:\n",
|
380 |
+
" pass\n",
|
381 |
+
"\n",
|
382 |
+
" for root, dirs, files in os.walk(LOGS_FOLDER):\n",
|
383 |
+
" # Excluding \"zips\" and \"mute\" directories\n",
|
384 |
+
" if \"zips\" in dirs:\n",
|
385 |
+
" dirs.remove(\"zips\")\n",
|
386 |
+
" if \"mute\" in dirs:\n",
|
387 |
+
" dirs.remove(\"mute\")\n",
|
388 |
+
"\n",
|
389 |
+
" for filename in files:\n",
|
390 |
+
" if filename != \"last_backup_timestamps.txt\":\n",
|
391 |
+
" filepath = os.path.join(root, filename)\n",
|
392 |
+
" if os.path.isfile(filepath):\n",
|
393 |
+
" backup_filepath = os.path.join(\n",
|
394 |
+
" GOOGLE_DRIVE_PATH,\n",
|
395 |
+
" os.path.relpath(filepath, LOGS_FOLDER),\n",
|
396 |
+
" )\n",
|
397 |
+
" backup_folderpath = os.path.dirname(backup_filepath)\n",
|
398 |
+
" if not os.path.exists(backup_folderpath):\n",
|
399 |
+
" os.makedirs(backup_folderpath)\n",
|
400 |
+
" last_backup_timestamp = last_backup_timestamps.get(filepath)\n",
|
401 |
+
" current_timestamp = os.path.getmtime(filepath)\n",
|
402 |
+
" if (\n",
|
403 |
+
" last_backup_timestamp is None\n",
|
404 |
+
" or float(last_backup_timestamp) < current_timestamp\n",
|
405 |
+
" ):\n",
|
406 |
+
" shutil.copy2(filepath, backup_filepath)\n",
|
407 |
+
" last_backup_timestamps[filepath] = str(current_timestamp)\n",
|
408 |
+
" if last_backup_timestamp is None:\n",
|
409 |
+
" new_files += 1\n",
|
410 |
+
" else:\n",
|
411 |
+
" updated_files += 1\n",
|
412 |
+
"\n",
|
413 |
+
"\n",
|
414 |
+
" for filepath in list(last_backup_timestamps.keys()):\n",
|
415 |
+
" if not os.path.exists(filepath):\n",
|
416 |
+
" backup_filepath = os.path.join(\n",
|
417 |
+
" GOOGLE_DRIVE_PATH, os.path.relpath(filepath, LOGS_FOLDER)\n",
|
418 |
+
" )\n",
|
419 |
+
" if os.path.exists(backup_filepath):\n",
|
420 |
+
" os.remove(backup_filepath)\n",
|
421 |
+
" deleted_files += 1\n",
|
422 |
+
" del last_backup_timestamps[filepath]\n",
|
423 |
+
"\n",
|
424 |
+
"\n",
|
425 |
+
" if updated_files > 0 or deleted_files > 0 or new_files > 0:\n",
|
426 |
+
" print(f\"Backup Complete: {new_files} new, {updated_files} updated, {deleted_files} deleted.\")\n",
|
427 |
+
" fully_updated = False\n",
|
428 |
+
" elif not fully_updated:\n",
|
429 |
+
" print(\"Files are up to date.\")\n",
|
430 |
+
" fully_updated = True\n",
|
431 |
+
"\n",
|
432 |
+
" with open(last_backup_timestamps_path, \"w\") as f:\n",
|
433 |
+
" for filepath, timestamp in last_backup_timestamps.items():\n",
|
434 |
+
" f.write(f\"{filepath}:{timestamp}\\n\")\n",
|
435 |
+
"\n",
|
436 |
+
" time.sleep(cooldown if fully_updated else 0.1)\n",
|
437 |
+
"\n",
|
438 |
+
"\n",
|
439 |
+
" except Exception as error:\n",
|
440 |
+
" print(f\"An error occurred during backup: {error}\")\n",
|
441 |
+
"\n",
|
442 |
+
"\n",
|
443 |
+
"if autobackups:\n",
|
444 |
+
" autobackups = False\n",
|
445 |
+
" print(\"Autobackup Disabled\")\n",
|
446 |
+
"else:\n",
|
447 |
+
" autobackups = True\n",
|
448 |
+
" print(\"Autobackup Enabled\")"
|
449 |
+
],
|
450 |
+
"metadata": {
|
451 |
+
"cellView": "form",
|
452 |
+
"id": "f1_HldSGyelO"
|
453 |
+
},
|
454 |
+
"execution_count": null,
|
455 |
+
"outputs": []
|
456 |
+
},
|
457 |
{
|
458 |
"cell_type": "code",
|
459 |
"source": [
|