FIX: need to create model when testing new embedding (#1192)

This commit is contained in:
Kris 2025-03-14 13:11:44 -04:00 committed by GitHub
parent 3533cd1acc
commit bd40076dc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 1 deletions

View File

@ -240,7 +240,20 @@ export default class AiEmbeddingEditor extends Component {
this.testRunning = true;
try {
const configTestResult = await this.args.model.testConfig(data);
let testModel;
// new embeddings
if (this.args.model.isNew || this.selectedPreset) {
testModel = this.store.createRecord("ai-embedding", {
...this.selectedPreset,
...data,
});
} else {
// existing embeddings
testModel = this.args.model;
}
const configTestResult = await testModel.testConfig(data);
this.testResult = configTestResult.success;
if (this.testResult) {