ó
    €Ï¹  ã                   ó®   • S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  S
 r " S S\R                  5      rSS0r\\l        g)z"ai-platform local predict command.é    )Úabsolute_import)Údivision)Úunicode_literals)Úbase)Úflags)Úlocal_utils)Úpredict_utilities)Úlogc                 ó4  • U R                  SSSS9  [        R                  R                  R	                  U 5        U R                  SS9nUR                  SSS9  UR                  S	S
S9  UR                  SSS9  [        R                  R	                  U 5        g)z=Add arguments for `gcloud ai-platform local predict` command.z--model-dirTzPath to the model.)ÚrequiredÚhelp)r   z--json-requesta,        Path to a local file containing the body of JSON request.

      An example of a JSON request:

          {
            "instances": [
              {"x": [1, 2], "y": [3, 4]},
              {"x": [-1, -2], "y": [-3, -4]}
            ]
          }

      This flag accepts "-" for stdin.
      )r   z--json-instancesa<        Path to a local file from which instances are read.
      Instances are in JSON format; newline delimited.

      An example of the JSON instances file:

          {"images": [0.0, ..., 0.1], "key": 3}
          {"images": [0.0, ..., 0.1], "key": 2}
          ...

      This flag accepts "-" for stdin.
      z--text-instancesa&        Path to a local file from which instances are read.
      Instances are in UTF-8 encoded text format; newline delimited.

      An example of the text instances file:

          107,4.9,2.5,4.5,1.7
          100,5.7,2.8,4.1,1.3
          ...

      This flag accepts "-" for stdin.
      N)Úadd_argumentr   ÚFRAMEWORK_MAPPERÚ
choice_argÚAddToParserÚadd_mutually_exclusive_groupÚSIGNATURE_NAME)ÚparserÚgroups     Ú(lib/surface/ai_platform/local/predict.pyÚ_AddLocalPredictArgsr      s°   € à×Ñm¨dÐ9MÐÑNÜ×Ñ×#Ñ#×/Ñ/°Ô7Ø
×
-Ñ
-°tÐ
-Ð
<€%Ø×ÑØð
ð ñ ð  ×ÑØð
ð ñ ð ×ÑØð
ð ñ ô ×Ñ×"Ñ" 6Õ*ó    c                   ó.   • \ rS rSrSr\S 5       rS rSrg)ÚPredictéP   zRun prediction locally.c                 ó   • [        U 5        g )N)r   )r   s    r   ÚArgsÚPredict.ArgsS   s
   € ä˜Õ r   c           	      ó@  • [         R                  R                  UR                  5      nU(       a  UR                  R                  5       OSnUR                  c  [        R                  R                  S5        [        R                  " UR                  UR                  UR                  UR                  UUR                  S9nUR!                  S5      (       dD  [#        U[$        5      (       a  UnOUR'                  S5      n[(        R*                  " U5      Ul        U$ )NÚ
tensorflowzIf the signature defined in the model is not serving_default then you must specify it via --signature-name flag, otherwise the command may fail.)Újson_requestÚjson_instancesÚtext_instancesÚ	frameworkÚsignature_nameÚformatÚpredictions)r   r   ÚGetEnumForChoicer$   ÚnameÚlowerr%   r
   ÚstatusÚPrintr   Ú
RunPredictÚ	model_dirr!   r"   r#   ÚIsSpecifiedÚ
isinstanceÚlistÚgetr	   ÚGetDefaultFormatr&   )ÚselfÚargsr$   Úframework_flagÚresultsr'   s         r   ÚRunÚPredict.RunW   sá   € Ü×&Ñ&×7Ñ7¸¿¹ÓG€IÞ/8Y—^‘^×)Ñ)Ô+¸l€NØ×ÑÑ"Ü	‡jj×Ñð Pô Qô ×$Ò$Ø‰Ø×&Ñ&Ø×*Ñ*Ø×*Ñ*Ø Ø×*Ñ*ñ,€Gð ×Ñ˜H×%Ñ%ä	GœT×	"Ñ	"Ø‰à—k‘k -Ó0ˆä%×6Ò6°{ÓC€d„kà€Nr   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ústaticmethodr   r8   Ú__static_attributes__r:   r   r   r   r   P   s   † Ùàñ!ó ð!õr   r   ÚDESCRIPTIONa'  *{command}* performs prediction locally with the given instances. It requires the
[TensorFlow SDK](https://www.tensorflow.org/install) be installed locally. The
output format mirrors `gcloud ai-platform predict` (online prediction).

You cannot use this command with custom prediction routines.
N)r?   Ú
__future__r   r   r   Úgooglecloudsdk.callioper   Ú$googlecloudsdk.command_lib.ml_enginer   r   r	   Úgooglecloudsdk.corer
   r   ÚCommandr   Ú_DETAILED_HELPÚdetailed_helpr:   r   r   Ú<module>rJ      sT   ðñ )å &Ý Ý 'å (Ý 6Ý <Ý BÝ #ò1+ôhˆdl‰lô ðD ð	ð	€ð '€Õ r   