Colab fixes

This commit is contained in:
oobabooga 2023-10-22 08:57:16 -07:00
parent c544f5cc51
commit 994502d41b

View file

@ -78,7 +78,7 @@
" !pip install -r extensions/api/requirements.txt --upgrade\n",
" !pip install -r temp_requirements.txt --upgrade\n",
"\n",
" print(\"\\033[1;32;1m\\n --> If you see a warning about \\\"previously imported packages\\\", just ignore it.\\n\\033[0;37;0m\")",
" print(\"\\033[1;32;1m\\n --> If you see a warning about \\\"previously imported packages\\\", just ignore it.\\033[0;37;0m\")\n",
" print(\"\\033[1;32;1m\\n --> There is no need to restart the runtime.\\n\\033[0;37;0m\")\n",
"\n",
" try:\n",
@ -98,6 +98,7 @@
" command_line_flags += f\" {param}\"\n",
"\n",
"model_url = model_url.strip()\n",
"if model_url != \"\":\n",
" if not model_url.startswith('http'):\n",
" model_url = 'https://huggingface.co/' + model_url\n",
"\n",
@ -110,9 +111,14 @@
" !python download-model.py {model_url} --branch {branch}\n",
" else:\n",
" !python download-model.py {model_url}\n",
"else:\n",
" output_folder = \"\"\n",
"\n",
"# Start the web UI\n",
"cmd = f\"python server.py --share --model {output_folder} {command_line_flags}\"\n",
"cmd = f\"python server.py --share\"\n",
"if output_folder != \"\":\n",
" cmd += f\" --model {output_folder}\"\n",
"cmd += f\" {command_line_flags}\"\n",
"print(cmd)\n",
"!$cmd"
],