Use threading for python. and make singals from python
This commit is contained in:
@@ -30,13 +30,11 @@ namespace PythonInterop {
|
||||
}
|
||||
}
|
||||
|
||||
public double[] PredictAI() {
|
||||
public int PredictAI(string StockSymbol) {
|
||||
using (Py.GIL()) {
|
||||
dynamic main = Py.Import("ai-predictor");
|
||||
string result = main.Predict();
|
||||
double[]? predictions = JsonSerializer.Deserialize<double[]>(result);
|
||||
double[] nullCasted = predictions != null ? predictions : [];
|
||||
return nullCasted;
|
||||
int result = main.Predict(StockSymbol);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user