Fix database startup issue.
This commit is contained in:
parent
f70176b184
commit
66b62fcd16
|
|
@ -61,13 +61,13 @@ namespace BotSharp.Core.Engines
|
|||
.Select(x => x.Trim())
|
||||
.ToList();
|
||||
|
||||
pipelines.ForEach(async pipeName =>
|
||||
for(int pipeIdx = 0; pipeIdx < pipelines.Count; pipeIdx++)
|
||||
{
|
||||
var pipe = TypeHelper.GetInstance(pipeName, assemblies) as INlpPredict;
|
||||
var pipe = TypeHelper.GetInstance(pipelines[pipeIdx], assemblies) as INlpPredict;
|
||||
pipe.Configuration = provider.Configuration;
|
||||
pipe.Settings = settings;
|
||||
await pipe.Predict(agent, data, meta.Pipeline.FirstOrDefault(x => x.Name == pipeName));
|
||||
});
|
||||
await pipe.Predict(agent, data, meta.Pipeline.FirstOrDefault(x => x.Name == pipelines[pipeIdx]));
|
||||
}
|
||||
|
||||
Console.WriteLine(JsonConvert.SerializeObject(data, new JsonSerializerSettings
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace BotSharp.RestApi.Rasa
|
|||
|
||||
if (String.IsNullOrEmpty(request.Model))
|
||||
{
|
||||
request.Model = Directory.GetDirectories(projectPath).Where(x => x.Contains("model_")).Last();
|
||||
request.Model = Directory.GetDirectories(projectPath).Where(x => x.Contains("model_")).Last().Split(Path.DirectorySeparatorChar).Last();
|
||||
}
|
||||
|
||||
var modelPath = Path.Combine(projectPath, request.Model);
|
||||
|
|
@ -88,7 +88,14 @@ namespace BotSharp.RestApi.Rasa
|
|||
Text = request.Text,
|
||||
Model = request.Model,
|
||||
Project = agent.Name,
|
||||
IntentRanking = new List<RasaResponseIntent> { }
|
||||
IntentRanking = new List<RasaResponseIntent>
|
||||
{
|
||||
new RasaResponseIntent
|
||||
{
|
||||
Name = aIResponse.Result.Metadata.IntentName,
|
||||
Confidence = aIResponse.Result.Score
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return rasaResponse;
|
||||
|
|
|
|||
|
|
@ -123,10 +123,10 @@ namespace BotSharp.WebHost
|
|||
AppDomain.CurrentDomain.SetData("ContentRootPath", env.ContentRootPath);
|
||||
AppDomain.CurrentDomain.SetData("Assemblies", Configuration.GetValue<String>("Assemblies").Split(','));
|
||||
|
||||
InitializationLoader loader = new InitializationLoader();
|
||||
/*InitializationLoader loader = new InitializationLoader();
|
||||
loader.Env = env;
|
||||
loader.Config = Configuration;
|
||||
loader.Load();
|
||||
loader.Load();*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue