minor changes on manage.sh and brain service
This commit is contained in:
@@ -21,16 +21,17 @@ def brain_commander(prompt, history):
|
||||
|
||||
brain = CloudChatBrain()
|
||||
|
||||
with gr.Blocks() as demo:
|
||||
with gr.Blocks(title="drone commander", analytics_enabled=False) as webui:
|
||||
chatbot_ui = gr.Chatbot(label="drone flight with chatgpt as copilot")
|
||||
state = gr.State([])
|
||||
with gr.Row():
|
||||
prompt = gr.Textbox(
|
||||
show_label=True,
|
||||
label="what should I do now? (enter q for emergency)",
|
||||
placeholder="Enter flight command and press enter")\
|
||||
placeholder="Enter flight command and press enter",
|
||||
interactive=True)\
|
||||
.style(container=True)
|
||||
prompt.submit(brain_commander, [prompt, state], [chatbot_ui, state])
|
||||
|
||||
|
||||
demo.launch(server_name="0.0.0.0", server_port=8890, debug=True, )
|
||||
webui.launch(server_name="0.0.0.0", server_port=8890, debug=True)
|
||||
12
manage.sh
12
manage.sh
@@ -99,7 +99,7 @@ elif [ "$1" == "list-wifis" ]; then
|
||||
list_wifi_ssid #connect $2 $3
|
||||
|
||||
elif [ "$1" == "connect-drone" ]; then
|
||||
connect_using_wpa_supp > logs/wpa_supp.log 2>&1 &
|
||||
connect_using_wpa_supp >> logs/wpa_supp.log 2>&1 &
|
||||
wpa_supp_pid=$!
|
||||
echo "started wpa supplicant to connect drone network with PID $wpa_supp_pid"
|
||||
echo $wpa_supp_pid > $pids_dir/wpa_supp_pid.txt
|
||||
@@ -112,7 +112,7 @@ elif [ "$1" == "disconnect-drone" ]; then
|
||||
fi
|
||||
|
||||
elif [ "$1" == "get-dhcp" ]; then
|
||||
get_dhcp_ip > logs/dhcp_ip.log 2>&1 &
|
||||
get_dhcp_ip >> logs/dhcp_ip.log 2>&1 &
|
||||
dhcp_ip_pid=$!
|
||||
echo "requested ip address from drone router with PID $dhcp_ip_pid"
|
||||
echo $dhcp_ip_pid > $pids_dir/dhcp_ip_pid.txt
|
||||
@@ -128,7 +128,7 @@ elif [ "$1" == "kill-dhcp" ]; then
|
||||
## DEV
|
||||
######################
|
||||
elif [ "$1" == "start-jupyter" ]; then
|
||||
start_jupyter > logs/jupyter.log 2>&1 &
|
||||
start_jupyter >> logs/jupyter.log 2>&1 &
|
||||
jupyter_pid=$!
|
||||
echo "started jupyter with PID $jupyter_pid"
|
||||
echo $jupyter_pid > $pids_dir/jupyter_pid.txt
|
||||
@@ -141,7 +141,7 @@ elif [ "$1" == "stop-jupyter" ]; then
|
||||
fi
|
||||
|
||||
elif [ "$1" == "start-cs" ]; then
|
||||
start_codeserver > logs/codeserver.log 2>&1 &
|
||||
start_codeserver >> logs/codeserver.log 2>&1 &
|
||||
codeserver_pid=$!
|
||||
echo "started code server with PID $codeserver_pid"
|
||||
echo $codeserver_pid > $pids_dir/codeserver_pid.txt
|
||||
@@ -162,7 +162,7 @@ elif [ "$1" == "turn-off" ]; then
|
||||
## DRONE
|
||||
######################
|
||||
elif [ "$1" == "start-commander" ]; then
|
||||
start_commander_service $2 > logs/commander.log 2>&1 &
|
||||
start_commander_service $2 >> logs/commander.log 2>&1 &
|
||||
commander_pid=$!
|
||||
echo "started commander with PID $commander_pid"
|
||||
echo $commander_pid > $pids_dir/commander_pid.txt
|
||||
@@ -176,7 +176,7 @@ elif [ "$1" == "stop-commander" ]; then
|
||||
fi
|
||||
|
||||
elif [ "$1" == "start-webui" ]; then
|
||||
start_webui_service $2 > logs/webui.log 2>&1 &
|
||||
start_webui_service $2 >> logs/webui.log 2>&1 &
|
||||
webui_pid=$!
|
||||
echo "started webui service with PID $webui_pid"
|
||||
echo $webui_pid > $pids_dir/webui_pid.txt
|
||||
|
||||
Reference in New Issue
Block a user