ahmedabu98 opened a new pull request, #37441:
URL: https://github.com/apache/beam/pull/37441

   Suggestion to print the generated text instead of the whole inference 
object. Makes for cleaner output text.
   
   Before:
   ```
   Input: Hello, my name is, Output: Completion(id='cmpl-97443af3adb4b458', 
choices=[CompletionChoice(finish_reason='length', index=0, logprobs=None, 
text=' Joel, my dad is Anton Harriman and my wife is Lydia. ', 
stop_reason=None, token_ids=None, prompt_logprobs=None, 
prompt_token_ids=None)], created=1769633627, model='facebook/opt-125m', 
object='text_completion', system_fingerprint=None, 
usage=CompletionUsage(completion_tokens=16, prompt_tokens=6, total_tokens=22, 
completion_tokens_details=None, prompt_tokens_details=None), service_tier=None, 
kv_transfer_params=None)
   Input: The president of the United States is, Output: 
Completion(id='cmpl-a2b37cf1c043b8fb', 
choices=[CompletionChoice(finish_reason='length', index=0, logprobs=None, 
text=' reportedly using a pressure cooker to make 10-second swim parts.\nThe 
Federal', stop_reason=None, token_ids=None, prompt_logprobs=None, 
prompt_token_ids=None)], created=1769633627, model='facebook/opt-125m', 
object='text_completion', system_fingerprint=None, 
usage=CompletionUsage(completion_tokens=16, prompt_tokens=8, total_tokens=24, 
completion_tokens_details=None, prompt_tokens_details=None), service_tier=None, 
kv_transfer_params=None)
   Input: The capital of France is, Output: 
Completion(id='cmpl-9f545aa5e9ccafcc', 
choices=[CompletionChoice(finish_reason='length', index=0, logprobs=None, 
text=" enragingly full of conservative opinions about the monarchy's role in 
society,", stop_reason=None, token_ids=None, prompt_logprobs=None, 
prompt_token_ids=None)], created=1769633628, model='facebook/opt-125m', 
object='text_completion', system_fingerprint=None, 
usage=CompletionUsage(completion_tokens=16, prompt_tokens=6, total_tokens=22, 
completion_tokens_details=None, prompt_tokens_details=None), service_tier=None, 
kv_transfer_params=None)
   Input: The future of AI is, Output: Completion(id='cmpl-90e315a3d50863df', 
choices=[CompletionChoice(finish_reason='length', index=0, logprobs=None, 
text=' in the cloud; in 2017, six of the eight most popular services cloud 
and', stop_reason=None, token_ids=None, prompt_logprobs=None, 
prompt_token_ids=None)], created=1769633628, model='facebook/opt-125m', 
object='text_completion', system_fingerprint=None, 
usage=CompletionUsage(completion_tokens=16, prompt_tokens=6, total_tokens=22, 
completion_tokens_details=None, prompt_tokens_details=None), service_tier=None, 
kv_transfer_params=None)
   Input: Emperor penguins are, Output: Completion(id='cmpl-a2990af8577889fe', 
choices=[CompletionChoice(finish_reason='length', index=0, logprobs=None, 
text=' so adorable. What is up with those adults neckbeard beards?\nSome', 
stop_reason=None, token_ids=None, prompt_logprobs=None, 
prompt_token_ids=None)], created=1769633628, model='facebook/opt-125m', 
object='text_completion', system_fingerprint=None, 
usage=CompletionUsage(completion_tokens=16, prompt_tokens=6, total_tokens=22, 
completion_tokens_details=None, prompt_tokens_details=None), service_tier=None, 
kv_transfer_params=None)
   ```
   
   After:
   ```
   Input: Hello, my name is, Output:  Joel, my dad is Anton Harriman and my 
wife is Lydia. 
   Input: The president of the United States is, Output:  reportedly using a 
pressure cooker to make 10-second swim parts.
   The Federal
   Input: The capital of France is, Output:  enragingly full of conservative 
opinions about the monarchy's role in society,
   Input: The future of AI is, Output:  in the cloud; in 2017, six of the eight 
most popular services cloud and
   Input: Emperor penguins are, Output:  so adorable. What is up with those 
adults neckbeard beards?
   Some
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to