forked from tianzhen889/KimiChatToV1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
35 lines (26 loc) · 730 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# 获取当前目录的路径
current_dir=$(pwd)
# 创建并激活虚拟环境
python3 -m venv venv
source venv/bin/activate
# 安装依赖
pip install -r requirements.txt -i https://pypi.douban.com/simple
# 创建 systemd 服务单元文件
cat > /etc/systemd/system/kimi-chat-to-v1.service << EOF
[Unit]
Description=Kimi Chat Service
After=network.target
[Service]
ExecStart=${current_dir}/venv/bin/python ${current_dir}/kimi_api_models.py
WorkingDirectory=${current_dir}
Restart=always
[Install]
WantedBy=multi-user.target
EOF
# 重新加载 systemd 配置
systemctl daemon-reload
# 启动服务
systemctl start kimi-chat-to-v1
# 设置服务在系统启动时自动启动
systemctl enable kimi-chat-to-v1