Merge pull request #1148 from city-unit/patch/collab
Fix collab to generate an api key
This commit is contained in:
commit
1189734c62
|
@ -73,6 +73,7 @@
|
|||
"#@markdown Enables ChromaDB for Infinity Context plugin\n",
|
||||
"\n",
|
||||
"import subprocess\n",
|
||||
"import secrets\n",
|
||||
"\n",
|
||||
"# ---\n",
|
||||
"# SillyTavern extras\n",
|
||||
|
@ -130,6 +131,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