ai-chatbot/finish_setup.exp
Your Name 53ddb7e585
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Initial commit - clean repository
2025-12-17 20:15:18 +08:00

38 lines
957 B
Plaintext
Executable File

#!/usr/bin/expect
set timeout -1
set host "156.225.27.52"
set port "5204"
set user "root"
set password "Jsjj@8888"
puts "--> Connecting to finish installation..."
spawn ssh -p $port $user@$host
expect {
"password:" { send "$password\r" }
"yes/no" { send "yes\r"; exp_continue }
}
expect "#"
send "source ~/miniconda3/bin/activate\r"
send "conda activate dreamomni2\r"
puts "--> Installing PyTorch (retrying)..."
# 使用 pip 的 --timeout 参数防止超时
send "pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --timeout 1000\r"
expect "#"
puts "--> Installing other dependencies..."
send "pip install transformers diffusers accelerate sentencepiece protobuf huggingface_hub modelscope\r"
expect "#"
puts "--> Verifying installation..."
send "python -c 'import torch; print(\"CUDA available:\", torch.cuda.is_available())'\r"
expect "#"
send "exit\r"
expect eof
puts "Deployment fix completed."