06c50f050dc143126636b6c9b7d80ee3468377a6,examples/serving/ende_client.py,,main,#,82

Before Change


  stub = prediction_service_pb2_grpc.PredictionServiceStub(channel)
  tokenizer = pyonmttok.Tokenizer("none", sp_model_path=args.sentencepiece_model)

  batch_input = ["Hello world!", "My name is John.", "I live on the West coast."]
  batch_output = translate(stub, args.model_name, batch_input, tokenizer, timeout=args.timeout)
  for input_text, output_text in zip(batch_input, batch_output):
    print("{} ||| {}".format(input_text, output_text))


if __name__ == "__main__":
  main()

After Change


  tokenizer = pyonmttok.Tokenizer("none", sp_model_path=args.sentencepiece_model)

  while True:
    text = input("Source: ")
    output = translate(stub, args.model_name, [text], tokenizer, timeout=args.timeout)
    print("Target: %s" % output[0])
    print("")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 06c50f050dc143126636b6c9b7d80ee3468377a6
Time: 2019-04-06
Author: guillaume.klein@systrangroup.com
File Name: examples/serving/ende_client.py
Class Name:
Method Name: main


Project Name: autorope/donkeycar
Commit Name: f9796d18c136fad0d06a720faf210c26aecf7ea5
Time: 2018-10-13
Author: liujiaming02@baidu.com
File Name: donkeycar/management/base.py
Class Name: CalibrateCar
Method Name: run


Project Name: TheAlgorithms/Python
Commit Name: b93a9d8e8faa115d06a6bd656f5bf0e91254c1de
Time: 2020-10-25
Author: kushagrabansalajmer@gmail.com
File Name: maths/lucas_series.py
Class Name:
Method Name: