class_docstr: Implementation class of an MII inference server
class_docstr_tok: ["Implementation","class","of","an","MII","inference","server"]
code: def GeneratorReplyStream(self, request, context):
      task_methods = self._get_task_methods("GeneratorReply")
  
      prompts, kwargs = task_methods.unpack_request_from_proto(request)
      uid = self.inference_pipeline.put_request(prompts[0], kwargs)
  
      while True:
          response_uid, r = self.inference_pipeline.get_response()
          assert uid == response_uid, "uid mismatch"
          done = r.finish_reason != GenerationFinishReason.NONE
          response = task_methods.pack_response_to_proto([r])
          yield response
          if done:
              break
  
      self.inference_pipeline.flush_uid(uid)
  
imports: import asyncio
  import queue
  import sys
  import threading
  from concurrent import futures
  from typing import Dict
  import grpc
  from google.protobuf import empty_pb2
  from mii.backend.client import create_channel
  from mii.constants import GenerationFinishReason, GRPC_MAX_MSG_SIZE, TERMINATE_METHOD, LB_MAX_WORKER_THREADS, SERVER_SHUTDOWN_TIMEOUT, STREAM_RESPONSE_QUEUE_TIMEOUT
  from mii.grpc_related.proto import modelresponse_pb2_grpc
  from mii.grpc_related.task_methods import TASK_METHODS_DICT, TaskMethods
label_desc: Use image node_id 4 for calling the ModelResponse obj's underlying member method code with example usage: obj.GeneratorReplyStream(request, context) without return types