63 lines
1.5 KiB
Plaintext
Executable File
63 lines
1.5 KiB
Plaintext
Executable File
#!/usr/bin/expect
|
|
|
|
set timeout -1
|
|
set host "156.225.27.52"
|
|
set port "5204"
|
|
set user "root"
|
|
set password $env(DEPLOY_SSH_PASSWORD)
|
|
|
|
# 定义测试指令
|
|
# 这是一个更通用的测试命令,先尝试列出文件确认脚本名
|
|
puts "--> Starting DreamOmni2 Inference Test..."
|
|
|
|
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"
|
|
send "cd ~/ai-projects/DreamOmni2\r"
|
|
|
|
# 1. 先检查有哪些脚本
|
|
puts "--> Checking available scripts..."
|
|
send "ls -F\r"
|
|
expect "#"
|
|
|
|
# 2. 运行示例
|
|
puts "--> Running inference_gen.py (Text-to-Image Generation)..."
|
|
# 注意:这里我们使用默认参数运行,或者查看脚本头部了解参数
|
|
# 假设 inference_gen.py 是官方提供的生成脚本
|
|
send "python inference_gen.py\r"
|
|
|
|
# 等待输出,这可能需要很长时间(加载模型+生成)
|
|
expect {
|
|
"Traceback" {
|
|
puts "\n[ERROR] Python Traceback detected!"
|
|
}
|
|
"Error" {
|
|
puts "\n[ERROR] General error detected!"
|
|
}
|
|
"Saved" {
|
|
puts "\n[SUCCESS] Image saved successfully!"
|
|
}
|
|
"Done" {
|
|
puts "\n[SUCCESS] Process completed!"
|
|
}
|
|
"#" {
|
|
# Catch prompt return if no specific message
|
|
}
|
|
}
|
|
|
|
# 3. 检查是否有结果生成
|
|
puts "--> Checking for generated images..."
|
|
send "ls -lh *.png *.jpg example_input/gen_tests/ 2>/dev/null\r"
|
|
expect "#"
|
|
|
|
send "exit\r"
|
|
expect eof
|
|
|
|
puts "Test run finished."
|