Spaces:
Building
Building
Update flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/version-edit-dialog/version-edit-dialog.component.ts
CHANGED
@@ -121,54 +121,51 @@ export default class VersionEditDialogComponent implements OnInit {
|
|
121 |
|
122 |
loadVersion(version: Version) {
|
123 |
this.selectedVersion = version;
|
124 |
-
|
125 |
-
// Reset form to initial state
|
126 |
-
this.initializeForm();
|
127 |
-
|
128 |
-
// Populate basic fields
|
129 |
this.versionForm.patchValue({
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
},
|
142 |
-
use_fine_tune: false,
|
143 |
-
fine_tune_zip: ''
|
144 |
},
|
145 |
-
|
|
|
146 |
});
|
147 |
-
|
148 |
-
//
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
});
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
this.
|
171 |
-
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
|
174 |
createIntentFormGroup(intent: any = {}): FormGroup {
|
|
|
121 |
|
122 |
loadVersion(version: Version) {
|
123 |
this.selectedVersion = version;
|
|
|
|
|
|
|
|
|
|
|
124 |
this.versionForm.patchValue({
|
125 |
+
caption: version.caption || '',
|
126 |
+
description: version.caption || '', // description yerine caption kullan
|
127 |
+
default_api: version.default_api || '',
|
128 |
+
published: version.published || false,
|
129 |
+
repo_id: version.llm?.repo_id || '',
|
130 |
+
generation_config: version.llm?.generation_config || {
|
131 |
+
max_new_tokens: 512,
|
132 |
+
temperature: 0.7,
|
133 |
+
top_p: 0.95,
|
134 |
+
top_k: 50,
|
135 |
+
repetition_penalty: 1.1
|
|
|
|
|
|
|
136 |
},
|
137 |
+
use_fine_tune: version.llm?.use_fine_tune || false,
|
138 |
+
fine_tune_zip: version.llm?.fine_tune_zip || ''
|
139 |
});
|
140 |
+
|
141 |
+
// Clear and rebuild intents
|
142 |
+
this.intents.clear();
|
143 |
+
(version.intents || []).forEach(intent => {
|
144 |
+
this.addIntent();
|
145 |
+
const intentIndex = this.intents.length - 1;
|
146 |
+
const intentGroup = this.intents.at(intentIndex);
|
147 |
+
|
148 |
+
intentGroup.patchValue({
|
149 |
+
name: intent.name,
|
150 |
+
description: intent.description || '',
|
151 |
+
api_to_call: intent.api_to_call || '',
|
152 |
+
enabled: intent.enabled !== false
|
153 |
});
|
154 |
+
|
155 |
+
// Add intent parameters
|
156 |
+
const paramsArray = this.getIntentParameters(intentIndex);
|
157 |
+
paramsArray.clear();
|
158 |
+
(intent.parameters || []).forEach(param => {
|
159 |
+
paramsArray.push(this.createParameterFormGroup(param));
|
160 |
+
});
|
161 |
+
|
162 |
+
// Add examples
|
163 |
+
const examplesArray = this.getIntentExamples(intentIndex);
|
164 |
+
examplesArray.clear();
|
165 |
+
(intent.examples || []).forEach(example => {
|
166 |
+
examplesArray.push(this.fb.control(example));
|
167 |
+
});
|
168 |
+
});
|
169 |
}
|
170 |
|
171 |
createIntentFormGroup(intent: any = {}): FormGroup {
|