Created
April 19, 2023 13:00
-
-
Save aasthavar/4baf36fe236f07b67251b9dfaffc9bb9 to your computer and use it in GitHub Desktop.
Inference Example
This file contains hidden or 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
| newline, bold, unbold = "\n", "\033[1m", "\033[0m" | |
| text1 = "Translate to German: My name is Arthur" | |
| text2 = "A step by step recipe to make bolognese pasta:" | |
| for text in [text1, text2]: | |
| query_response = query_endpoint(text.encode("utf-8"), endpoint_name=endpoint_name) | |
| generated_text = parse_response(query_response) | |
| print( | |
| f"Inference:{newline}" | |
| f"input text: {text}{newline}" | |
| f"generated text: {bold}{generated_text}{unbold}{newline}" | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment