mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-19 12:43:07 +01:00
Fix collab to generate an api key
This commit is contained in:
parent
ed86e8de04
commit
a78bb82b44
@ -73,6 +73,7 @@
|
||||
"#@markdown Enables ChromaDB for Infinity Context plugin\n",
|
||||
"\n",
|
||||
"import subprocess\n",
|
||||
"import secrets\n",
|
||||
"\n",
|
||||
"# ---\n",
|
||||
"# SillyTavern extras\n",
|
||||
@ -119,6 +120,13 @@
|
||||
"!wget https://github.com/cloudflare/cloudflared/releases/download/2023.5.0/cloudflared-linux-amd64 -O /tmp/cloudflared-linux-amd64\n",
|
||||
"!chmod +x /tmp/cloudflared-linux-amd64\n",
|
||||
"\n",
|
||||
"# Generate a random API key\n",
|
||||
"api_key = secrets.token_hex(5)\n",
|
||||
"\n",
|
||||
"# Write the API key to api_key.txt\n",
|
||||
"with open('./api_key.txt', 'w') as f:\n",
|
||||
" f.write(api_key)\n",
|
||||
"print(f\"API Key generated: {api_key}\")\n",
|
||||
"\n",
|
||||
"cmd = f\"python server.py {' '.join(params)}\"\n",
|
||||
"print(cmd)\n",
|
||||
|
Loading…
Reference in New Issue
Block a user