Last active
November 5, 2019 21:31
-
-
Save caleb-kaiser/e8d954987abdd96ca6db163c38f302f2 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
from encoder import get_encoder | |
encoder = get_encoder() | |
def pre_inference(sample, signature, metadata): | |
context = encoder.encode(sample["text"]) | |
return {"context": [context]} | |
def post_inference(prediction, signature, metadata): | |
response = prediction["sample"] | |
return encoder.decode(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment