created low code script for model deployment
This commit is contained in:
parent
5f2db4d0c9
commit
4f6c3b7370
43
predict_pipeline/predict_sample.py
Normal file
43
predict_pipeline/predict_sample.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Imports
|
||||
import pandas as pd
|
||||
import json
|
||||
from pathlib import Path
|
||||
import numpy as np
|
||||
|
||||
def getLastEntryFromSQLite():
|
||||
|
||||
return
|
||||
|
||||
def callModel(sample):
|
||||
prediction: np.int32 = sample # noch unklar ob jedes mal ein load oder z.B. mit Flask API
|
||||
return prediction
|
||||
|
||||
def getMessageConfig( config_file_path):
|
||||
|
||||
return dict()
|
||||
|
||||
|
||||
def buildMessage(result: np.int32, config: dict):
|
||||
# message =json...
|
||||
message = 5
|
||||
return message
|
||||
|
||||
|
||||
def sendMessage(destination, message):
|
||||
return 2
|
||||
|
||||
def main():
|
||||
config_file_path = Path("")
|
||||
config = getMessageConfig(config_file_path=config_file_path)
|
||||
|
||||
sample = getLastEntryFromSQLite()
|
||||
|
||||
prediction = callModel(sample=sample)
|
||||
|
||||
message = buildMessage(result=prediction, config=config)
|
||||
|
||||
sendMessage(config, message)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
x
Reference in New Issue
Block a user