代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
set -euo pipefail
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function cleanup {
echo "Stopping react server"
npx --prefix "${this_dir}/sweagent/frontend" pm2 delete swe-agent
echo "Stopping Flask server"
kill "$flask_pid" 2>/dev/null
echo "Cleanup complete"
}
function print_log {
echo "Something went wrong. Here's web_api.log:"
echo "----------"
cat web_api.log
echo "----------"
}
trap print_log ERR
python sweagent/api/server.py > web_api.log 2>&1 &
flask_pid=$!
cd "${this_dir}/sweagent/frontend"
npm install
trap cleanup EXIT
npx pm2 start --name swe-agent npm -- start
echo "* If you are running on your own machine, then a browser window "
echo " should have already opened. If not, wait a few more seconds, then "
echo " open your browser at http://localhost:3000"
echo "* If you are running in github codespaces, please click the popup "
echo " that offers to forward port 3000 (not 8000!)."
echo " Missed it? Find more information at "
echo " https://princeton-nlp.github.io/SWE-agent/installation/codespaces#running-the-web-ui"
echo "* Something went wrong? Please check "
echo " web_api.log for error messages!"
echo "* See here for more information: https://princeton-nlp.github.io/SWE-agent/usage/web_ui/"
cd ../../
wait
exit $?
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。