| 139 | } |
| 140 | |
| 141 | void UTTaskPool::createModels(const QString &model) |
| 142 | { |
| 143 | QList<AbstractLLM *> models; |
| 144 | for (int i = 0; i < kMaxModelCount; ++i) { |
| 145 | auto llm = SmartUTManager::instance()->findModel(model); |
| 146 | if (llm) { |
| 147 | models << llm; |
| 148 | connect(llm, &AbstractLLM::modelStateChanged, this, std::bind(&UTTaskPool::handleModelStateChanged, this, llm)); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | if (!models.isEmpty()) |
| 153 | idleModels.insert(model, models); |
| 154 | } |