Fix HF dataset import internal error and training SQLite readiness.
Wrap AssistentImportHfDataset in try/catch, batch inserts in a transaction, clearer HF rows errors for gated datasets, EnsureTrainingReady with actionable message, and friendlier training UI errors instead of generic internal error. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,14 +25,21 @@ public partial class SwarmAssistentExtension
|
||||
public async Task<JObject> AssistentGetDatasetAgentSettings(Session session)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
JObject settings = Config.LoadTrainingAgent();
|
||||
return new JObject
|
||||
try
|
||||
{
|
||||
["success"] = true,
|
||||
["settings"] = settings,
|
||||
["linked"] = Memory.CountAgentLinkedTrainSamples(),
|
||||
["approved"] = Memory.CountTrainSamples("approved"),
|
||||
};
|
||||
JObject settings = Config.LoadTrainingAgent();
|
||||
return new JObject
|
||||
{
|
||||
["success"] = true,
|
||||
["settings"] = settings,
|
||||
["linked"] = Memory.CountAgentLinkedTrainSamples(),
|
||||
["approved"] = Memory.CountTrainSamples("approved"),
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new JObject { ["error"] = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<JObject> AssistentSaveDatasetAgentSettings(Session session, JObject settings)
|
||||
|
||||
Reference in New Issue
Block a user