Spaces:
Paused
Paused
Download entrypoint.sh from onlyrickroll/chat10: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/spaces/onlyrickroll/chat10/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/onlyrickroll/chat10/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/onlyrickroll/chat10/resolve/main/entrypoint.sh
1.55 kB
| # 创建配置目录 | |
| mkdir -p ~/.nanobot | |
| mkdir -p ~/.nanabot/workspace | |
| echo $PATH | |
| apt install dnsutils -y | |
| dig api.telegram.org | |
| dig discord.com/api/v10 | |
| cat /dev/null >/etc/resolv.conf | |
| cat <<EOF >> /etc/resolv.conf | |
| nameserver 1.1.1.1 | |
| nameserver 8.8.8.8 | |
| nameserver 2606:4700:4700::1111 | |
| nameserver 2606:4700:4700::1001 | |
| EOF | |
| dig api.telegram.org | |
| dig discord.com/api/v10 | |
| # 直接写入配置(对接你本地的 PowerServe 或 Ollama API) | |
| cat <<EOF > ~/.nanobot/config.json | |
| { | |
| "providers": { | |
| "vllm": { | |
| "apiKey": "dummy", | |
| "apiBase": "http://localhost:8080/v1" | |
| } | |
| }, | |
| "agents": { | |
| "defaults": { | |
| "workspace": "~/.nanobot/workspace", | |
| "model": "vllm/qwen3-4b" | |
| } | |
| }, | |
| "channels": { | |
| "telegram": { | |
| "enabled": true , | |
| "token": "$TG_TOKEN" , | |
| "allowFrom": ["$TG_ID"] , | |
| "proxy": null | |
| }, | |
| "discord": { | |
| "enabled": true, | |
| "token": "$DC_TOKEN", | |
| "allowFrom": ["$DC_ID"] | |
| } | |
| } | |
| } | |
| EOF | |
| # 1. 启动 C++ 服务 (llama-server) | |
| # 将端口改为 8080,并放到后台 | |
| echo "Starting llama-server on port 8080..." | |
| ./llama-server -m "/app/Qwen3VL-4B-Instruct-Q4_K_M.gguf" --host "127.0.0.1" --port "8080" \ | |
| -t "2" -c "8192" --flash-attn "on" --no-mmap --mlock & | |
| echo "Starting Python bot on port 8888..." | |
| ~/.local/bin/nanobot gateway -p 8888 & | |
| ~/.local/bin/nanobot status | |
| ~/.local/bin/nanobot --help | |
| # 4. 启动 Nginx 作为主进程 (监听 7860) | |
| # daemon off 确保容器不会立即退出 | |
| echo "Starting Nginx reverse proxy on port 7860..." | |
| nginx -g "daemon off;" |