Created
December 15, 2020 21:00
-
-
Save caleb-kaiser/d01262cbe3014cbd1c407527edbf6fa6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import whatever dependencies your API needs | |
import os | |
from metaflow import DataArtifact | |
os.environ['METAFLOW_USER'] = 'cortex' | |
class PythonPredictor: | |
def __init__(self, config): | |
# Initialize your model here | |
print("Got config to be %s" % str(config)) | |
self.model = DataArtifact(config['model_artifact']).data | |
def predict(self, payload): | |
# Payload is the request your endpoint receives | |
prediction = self.model | |
return prediction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment