§
    ïXÊjX5 ã                  ó0  — d Z ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZ ddlmZmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
l m!Z! ddl"m#Z# ddlm$Z$ ddl%m&Z&m'Z' ddl(Z(ddl)Z)ddl)m*Z*m+Z+ ddl,m-Z-m.Z.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9m:Z:m;Z; ddl<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZD e	jE         F                    d¦  «        p# eG e# ejH        ¦   «         ¦  «        dz  ¦  «        ZIdZJdZKdZL e7dddd¦  «         G d„ d ¦  «        ¦   «         ZMe G d!„ d"¦  «        ¦   «         ZNe G d#„ d$¦  «        ¦   «         ZO G d%„ d&¦  «        ZP e7d'd(d)¦  «         G d*„ d+e¦  «        ¦   «         ZQdS ),z,The main Client class for the Python client.é    )ÚannotationsN)Údeque)ÚAsyncGeneratorÚCallable)ÚFuture)Úcopy_context)Ú	dataclass)Údatetime)Úpartial)ÚPath)ÚLock)ÚAnyÚLiteral)ÚSpaceHardwareÚ
SpaceStage)ÚRepositoryNotFoundErrorÚbuild_hf_headersÚsend_telemetry)Úversion)Úutils)ÚParameterInfo)Údocument)ÚAppErrorÚAuthenticationErrorÚValidationError)ÚCommunicatorÚ	JobStatusÚMessageÚ
QueueErrorÚServerMessageÚStatusÚStatusUpdateÚUpdateÚGRADIO_TEMP_DIRÚgradioé   é<   é   ÚpredictÚsubmitÚview_apiÚ	duplicatec                  ó,  — e Zd ZdZ	 	 	 	 	 dZdedddddœd[d„Zd„ Zed\d!„¦   «         Zd]d'„Z	d(„ Z
e	 	 	 	 	 	 	 	 d^d_d1„¦   «         Zd2„ Zdddd3œd`d8„Z	 dadbd:„Zddddd;œdcd?„Zd@„ Z	 	 	 dddedG„ZdfdH„ZdgdJ„ZdhdO„ZdP„ ZdQ„ ZdfdR„ZdidS„ZdT„ ZdjdU„ZdkdW„ZdldY„ZdS )mÚClientaØ  
    The main Client class for the Python client. This class is used to connect to a remote Gradio app and call its API endpoints.

    Example:
        from gradio_client import Client

        client = Client("abidlabs/whisper-large-v2")  # connecting to a Hugging Face Space
        client.predict("test.mp4", api_name="/predict")
        >> What a nice recording! # returns the result of the remote API call

        client = Client("https://bec81a83-5b5c-471e.gradio.live")  # connecting to a temporary Gradio share URL
        job = client.submit("hello", api_name="/predict")  # runs the prediction in a background thread
        job.result()
        >> 49 # returns the result of the remote API call (blocking call)
    Né(   T)ÚheadersÚdownload_filesÚ
ssl_verifyÚ_skip_componentsÚanalytics_enabledÚoauth_tokenÚsrcÚstrÚtokenú
str | NoneÚmax_workersÚintÚverboseÚboolÚauthútuple[str, str] | NoneÚhttpx_kwargsúdict[str, Any] | Noner0   údict[str, str] | Noner1   ústr | Path | Literal[False]r2   r3   r4   r5   c               ó€  ‡ — |‰ _         |‰ _        |‰ _        |‰ _        |
‰ _        t          |dt          j        ¬¦  «        ‰ _        d‰ j        v r‰ j        d         ‰ j        d<   ‰ j        d= |r‰ j         	                    |¦  «         |	‰ _
        d‰ _        d‰ _        |€i n|‰ _        t          ‰ j                             di ¦  «        pi ¦  «        ‰ _        t#          ‰ j        t$          t&          f¦  «        r•t(          j                             ‰ j        ¦  «        st)          j        ‰ j        d¬	¦  «         t(          j                             ‰ j        ¦  «        st3          d
‰ j        › d�¦  «        ‚t%          ‰ j        ¦  «        ‰ _        nt6          ‰ _        |                     d¦  «        s|                     d¦  «        r|                     d¦  «        r|n|dz   }n1‰                      |¦  «        }|€t3          d|› d�¦  «        ‚|‰ _        |‰ _        ‰                       ¦   «         }|tB          j"        k    ro‰ j         rtG          d¦  «         ‰                       ¦   «         tB          j"        k    r7tI          j%        d¦  «         	 ‰                       ¦   «         tB          j"        k    °7|t          j&        v rt3          d|› d�¦  «        ‚‰ j         rtG          d‰ j        › �¦  «         |�‰  '                    |¦  «         ‰  (                    ¦   «         ‰ _)        ‰ j)         *                    dd¦  «        ‰ _+        ‰ j)         *                    dd¦  «        }| ,                    d¦  «        dz   ‰ _-        t\          j/         0                    ‰ j        ‰ j-        ¦  «         1                    d¦  «        dz   ‰ _2        t\          j/         0                    ‰ j2        t          j3        ¦  «        ‰ _4        t\          j/         0                    ‰ j2        ‰ j+        dk    rt          j5        nt          j6        ¦  «        ‰ _7        t\          j/         0                    ‰ j2        t          j8        ¦  «        ‰ _9        t\          j/         0                    ‰ j2        ‰ j+        dk    rt          j:        nt          j;        ¦  «        ‰ _<        t\          j/         0                    ‰ j2         =                    ddd¦  «        t          j>        ¦  «        ‰ _?        t\          j/         0                    ‰ j2        t          j@        ¦  «        ‰ _A        t\          j/         0                    ‰ j2        t          jB        ¦  «        ‰ _C        t‰          j/        ‰ j)         *                    dd¦  «        ¦  «        ‰ _E        ‰  F                    ¦   «         ‰ _G        t%          t‘          jI        ¦   «         ¦  «        ‰ _J        ˆ fd„t—          ‰ j)        d          ¦  «        D ¦   «         ‰ _L        tš          jN         O                    |¬!¦  «        ‰ _P        tš          jN         O                    d|z  ¬!¦  «        ‰ _Q        tš          jN         O                    d¬!¦  «        ‰ _R        |pt)          jS        d"d#¦  «        d#k    ‰ _T        ‰ jT        r-t«          jV        ‰ jW        d¬$¦  «         X                    ¦   «          t«          jY        ¦   «         ‰ _Z        t«          jY        ¦   «         ‰ _[        t«          jV        t¸          j]        t½          j_        ‰ ¦  «        ‰ jZ        ‰ j[        fd¬%¦  «        ‰ _`        ‰ j)         *                    d&d¦  «        r‰ j`         X                    ¦   «          d‰ _a        d‰ _b        i ‰ _c        tÉ          ¦   «         ‰ _e        t«          jf        ¦   «         ‰ _g        d'‰ _h        i ‰ _i        dS )(uÄ  
        Parameters:
            src: either the name of the Hugging Face Space to load, (e.g. "abidlabs/whisper-large-v2") or the full URL (including "http" or "https") of the hosted Gradio app to load (e.g. "http://mydomain.com/app" or "https://bec81a83-5b5c-471e.gradio.live/").
            token: optional Hugging Face token to use to access private Spaces. By default, the locally saved token is used if there is one. Find your tokens here: https://huggingface.co/settings/tokens.
            max_workers: maximum number of thread workers that can be used to make requests to the remote Gradio app simultaneously.
            verbose: whether the client should print statements to the console.
            headers: additional headers to send to the remote Gradio app on every request. By default only the HF authorization and user-agent headers are sent. This parameter will override the default headers if they have the same keys.
            download_files: directory where the client should download output files  on the local machine from the remote API. By default, uses the value of the GRADIO_TEMP_DIR environment variable which, if not set by the user, is a temporary directory on your machine. If False, the client does not download files and returns a FileData dataclass object with the filepath on the remote machine instead.
            ssl_verify: if False, skips certificate validation which allows the client to connect to Gradio apps that are using self-signed certificates.
            httpx_kwargs: additional keyword arguments to pass to `httpx.Client`, `httpx.stream`, `httpx.get` and `httpx.post`. This can be used to set timeouts, proxies, http auth, etc.
            analytics_enabled: Whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True.
            oauth_token: optional Hugging Face token for the app to act on your behalf, for endpoints whose function takes a `gr.OAuthToken`. Unlike `token`, which only authenticates you to the app, this is passed to the app's code, so it is sent only to endpoints that declare they need it â€” `view_api()` marks those. It is never sent anywhere else, and is not inferred from your locally saved token.
        Úgradio_client)r8   Úlibrary_nameÚlibrary_versionÚauthorizationzx-hf-authorizationNFÚcookiesT©Úexist_okzPath: z is not a directory.úhttp://úhttps://ú/úCould not find Space: z@. If it is a private Space, please provide a Hugging Face token.z'Space is still building. Please wait...é   z+The current space is in the invalid state: z'. Please contact the owner to fix this.zLoaded as API: ÚprotocolÚwsÚ
api_prefixÚ ÚsseÚhttpr&   r   z2.0c           
     ó–   •— i | ]E\  }}|                      d |¦  «        t          ‰|                      d |¦  «        |‰j        ¦  «        “ŒFS )Úid)ÚgetÚEndpointrQ   )Ú.0Úfn_indexÚ
dependencyÚselfs      €úEC:\Projects\Historical\venv\Lib\site-packages\gradio_client/client.pyú
<dictcomp>z#Client.__init__.<locals>.<dictcomp>Ê   sb   ø€ ð 
ð 
ð 
ñ %�˜*ð �NŠN˜4 Ñ*Ô*­HØ�j—n’n T¨8Ñ4Ô4°jÀ$Ä-ñ-ô -ð
ð 
ð 
ó    Údependencies)r:   ÚGRADIO_ANALYTICS_ENABLEDÚTrue)ÚtargetÚdaemon)re   Úargsrf   Úconnect_heartbeatr   )jr<   r8   r5   r1   r3   r   r   Ú__version__r0   Úupdater2   Úspace_idÚ_space_is_privater@   ÚdictÚpoprI   Ú
isinstancer7   r   ÚosÚpathÚexistsÚmakedirsÚisdirÚ
ValueErrorÚ
output_dirÚDEFAULT_TEMP_DIRÚ
startswithÚendswithÚ_space_name_to_srcr6   Ú_get_space_stater   ÚBUILDINGÚprintÚtimeÚsleepÚINVALID_RUNTIMEÚ_loginÚ_get_configÚconfigrY   rQ   ÚlstriprS   ÚurllibÚparseÚurljoinÚrstripÚsrc_prefixedÚAPI_URLÚapi_urlÚ
SSE_URL_V0ÚSSE_URLÚsse_urlÚHEARTBEAT_URLÚheartbeat_urlÚSSE_DATA_URL_V0ÚSSE_DATA_URLÚsse_data_urlÚreplaceÚWS_URLÚws_urlÚ
UPLOAD_URLÚ
upload_urlÚ	RESET_URLÚ	reset_urlr   Úapp_versionÚ_get_api_infoÚ_infoÚuuidÚuuid4Úsession_hashÚ	enumerateÚ	endpointsÚ
concurrentÚfuturesÚThreadPoolExecutorÚexecutorÚhelper_executorÚstream_executorÚgetenvr4   Ú	threadingÚThreadÚ_telemetry_threadÚstartÚEventÚ_refresh_heartbeatÚ_kill_heartbeatr.   Ú_stream_heartbeatÚweakrefÚrefÚ	heartbeatÚstream_openÚstreaming_futureÚpending_messages_per_eventÚsetÚpending_event_idsr   Úpending_lockÚstream_epochÚpending_event_epoch)r^   r6   r8   r:   r<   r>   r@   r0   r1   r2   r3   r4   r5   Ú_srcÚstaterS   s   `               r_   Ú__init__zClient.__init__T   sé  ø€ ð: ˆŒØˆŒ
Ø&ˆÔØ,ˆÔØ 0ˆÔÝ'ØØ(Ý!Ô-ð
ñ 
ô 
ˆŒð
 ˜dœlÐ*Ð*Ø15´¸oÔ1NˆDŒLÐ-Ñ.Ø”˜_Ð-Øð 	)ØŒL×Ò Ñ(Ô(Ð(Ø$ˆŒØˆŒØ!&ˆÔØ".Ð"6˜B˜B¸LˆÔÝ'+ØÔ×"Ò" 9¨bÑ1Ô1Ð8°bñ(
ô (
ˆŒõ �dÔ)­Cµ¨;Ñ7Ô7ð 	/Ý”7—>’> $Ô"5Ñ6Ô6ð @Ý”˜DÔ/¸$Ð?Ñ?Ô?Ð?Ý”7—=’= Ô!4Ñ5Ô5ð UÝ Ð!S¨$Ô*=Ð!SÐ!SÐ!SÑTÔTÐTÝ! $Ô"5Ñ6Ô6ˆDŒOˆOå.ˆDŒOà�>Š>˜)Ñ$Ô$ð 	 ¨¯ª°zÑ(BÔ(Bð 	 ØŸ,š, sÑ+Ô+Ð:�3�3°°s±ˆDˆDà×*Ò*¨3Ñ/Ô/ˆDØˆ|Ý Ør¨SÐrÐrÐrñô ð ð  ˆDŒMØˆŒØ×%Ò%Ñ'Ô'ˆØ•JÔ'Ò'Ð'ØŒ|ð AÝÐ?Ñ@Ô@Ð@Ø×'Ò'Ñ)Ô)­ZÔ-@Ò@Ð@Ý”
˜1‘”�Øð ×'Ò'Ñ)Ô)­ZÔ-@Ò@Ð@ð •EÔ)Ð)Ð)Ýð8¸eð 8ð 8ð 8ñô ð ð Œ<ð 	0ÝÐ. D¤HÐ.Ð.Ñ/Ô/Ð/àÐØ�KŠK˜ÑÔÐà×&Ò&Ñ(Ô(ˆŒàŒK�OŠO˜J¨Ñ-Ô-ð 	Œð œ+Ÿ/š/¨,¸Ñ;Ô;ˆ
Ø$×+Ò+¨CÑ0Ô0°3Ñ6ˆŒåŒL× Ò  ¤¨4¬?Ñ;Ô;×BÒBÀ3ÑGÔGÈ#ÑMð 	Ôõ ”|×+Ò+¨DÔ,=½u¼}ÑMÔMˆŒÝ”|×+Ò+ØÔØ $¤°Ò 6Ð 6�EÔÐ½E¼Mñ
ô 
ˆŒõ $œ\×1Ò1ØÔ�uÔ2ñ
ô 
ˆÔõ #œL×0Ò0ØÔØ%)¤]°eÒ%;Ð%;�EÔ!Ð!ÅÔASñ
ô 
ˆÔõ ”l×*Ò*ØÔ×%Ò% f¨d°AÑ6Ô6½¼ñ
ô 
ˆŒõ !œ,×.Ò.¨tÔ/@Å%ÔBRÑSÔSˆŒÝœ×-Ò-¨dÔ.?ÅÄÑQÔQˆŒÝ"œ=¨¬¯ª¸ÀEÑ)JÔ)JÑKÔKˆÔØ×'Ò'Ñ)Ô)ˆŒ
Ý¥¤
¡¤Ñ-Ô-ˆÔð
ð 
ð 
ð 
õ )2°$´+¸nÔ2MÑ(NÔ(Nð	
ñ 
ô 
ˆŒõ #Ô*×=Ò=È+Ð=ÑVÔVˆŒõ  *Ô1×DÒDØ˜K™ð  Eñ  
ô  
ˆÔõ
  *Ô1×DÒDÐQRÐDÑSÔSˆÔð ÐX¥¤Ð+EÀvÑ!NÔ!NÐRXÒ!Xð 	Ôð Ô!ð 	QÝÔ DÔ$:À4ÐHÑHÔH×NÒNÑPÔPÐPÝ"+¤/Ñ"3Ô"3ˆÔÝ(œÑ0Ô0ˆÔå"Ô)ÝÔ+Ý”+˜dÑ#Ô# TÔ%<¸dÔ>RÐSØð
ñ 
ô 
ˆŒð
 Œ;�?Š?Ð.°Ñ5Ô5ð 	#ØŒN× Ò Ñ"Ô"Ð"à ˆÔØ/3ˆÔØLNˆÔ'Ý+.©5¬5ˆÔÝ%œNÑ,Ô,ˆÔØˆÔØ35ˆÔ Ð Ð ra   c                ó¤   — | j                              ¦   «          | j                             ¦   «         r| j                             d¬¦  «         d S d S )Nr&   ©Útimeout)r°   r¸   r´   Úis_aliveÚjoin©r^   s    r_   ÚclosezClient.closeô   sV   € ØÔ× Ò Ñ"Ô"Ð"ØŒ>×"Ò"Ñ$Ô$ð 	+ØŒN×Ò¨ÐÑ*Ô*Ð*Ð*Ð*ð	+ð 	+ra   Ú
client_refúweakref.ref[Client]Úrefresh_heartbeatúthreading.EventÚkill_heartbeatc                óF  — t           }|                     ¦   «         �s | ¦   «         }|€d S |                     ¦   «          |j                             |j        ¬¦  «        }|j                             ¦   «         }|                     dd¦  «         |j	        |j
        |j        }	}}~d}
	 t          j        d|f|||	dœ|¤Ž5 }|j        p
|j        dk    }|j        s|s	 d d d ¦  «         d S |j	                             dd	¦  «                             d
¦  «        }|j        rŒ|rŠt'          j        ¦   «         }|                     ¦   «         D ]b}t'          j        ¦   «         |z
  t,          k    rt           }|                     ¦   «         r d d d ¦  «         d S |                     ¦   «         rd}
 nŒcd d d ¦  «         n# 1 swxY w Y   n# t          j        $ r Y d S w xY w|
r�ŒÓ|                     |¦  «        rd S t3          |dz  t4          ¦  «        }|                     ¦   «         �¯d S d S )N©r    rÂ   é   FÚGET©r0   rI   Úverifyé­  zcontent-typerT   ztext/event-streamTrP   )ÚHEARTBEAT_RETRY_DELAY_MINÚis_setÚclearr�   Úformatr    r@   ÚcopyÚ
setdefaultr0   rI   r2   ÚhttpxÚstreamÚis_server_errorÚstatus_codeÚ
is_successrY   rx   r~   Ú	monotonicÚ
iter_linesÚHEARTBEAT_RETRY_RESET_AFTERÚTransportErrorÚwaitÚminÚHEARTBEAT_RETRY_DELAY_MAX)rÇ   rÉ   rË   Úretry_delayÚclientÚurlr@   r0   rI   r2   Ú	refreshedÚresponseÚ	retryableÚis_event_streamÚstream_startedÚ_s                   r_   r±   zClient._stream_heartbeatù   s  € õ 0ˆØ ×'Ò'Ñ)Ô)ñ 1	JØ�Z‘\”\ˆFØˆ~Ø�Ø×#Ò#Ñ%Ô%Ð%ØÔ&×-Ò-¸6Ô;NÐ-ÑOÔOˆCØ!Ô.×3Ò3Ñ5Ô5ˆLØ×#Ò# I¨rÑ2Ô2Ð2à”Ø”ØÔ!ð )�WˆGð
 ØˆIðÝ”\ØØðð $Ø#Ø%ðð ð #ðð ð &ð Ø (Ô 8Ð W¸HÔ<PÐTWÒ<W�IØ#Ô.ð °yð Øð&ð &ð &ñ &ô &ð &ð &ð &ð '/Ô&6×&:Ò&:Ø&¨ñ'ô 'ç ’jÐ!4Ñ5Ô5ð $ð  Ô*ð &¨ð &Ý)-¬Ñ)9Ô)9˜Ø!)×!4Ò!4Ñ!6Ô!6ð 
&ð 
&˜Aå $¤Ñ 0Ô 0°>Ñ AÝ#>ò!?ð !?õ /H Ø-×4Ò4Ñ6Ô6ð 'Ø &ð/&ð &ð &ñ &ô &ð &ð &ð &ð0  1×7Ò7Ñ9Ô9ð &Ø,0 	Ø % ð&ð1&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &øøõ6 Ô'ð ð ð Ø��ðøøøàð ÙØ×"Ò" ;Ñ/Ô/ð Ø�Ý˜k¨A™oÕ/HÑIÔIˆKðc !×'Ò'Ñ)Ô)ñ 1	Jð 1	Jð 1	Jð 1	Jð 1	JsO   Â'G Â>F5ÃG Ã(BF5ÆG ÆF5Æ)G Æ5F9Æ9G Æ<F9Æ=G ÇGÇGrQ   ú1Literal['sse_v1', 'sse_v2', 'sse_v2.1', 'sse_v3']r    ÚreturnÚNonec           	     óP  — 	 | j                              ¦   «         }|                     dt          j        d ¬¦  «        ¦  «         t          j        dd| j        i|¤Ž5 }|                     d| j        d|i| j	        | j
        ¬¦  «        5 }d}|                     ¦   «         D �]‰}||z  }d|v �r||                     dd	¦  «        \  }}|                     d
¦  «                             d¦  «        }t          |¦  «        sŒV|                     d¦  «        �rýt#          j        |dd …         ¦  «        }	|	d         t&          j        k    rŒŸ|	                     dd¦  «        t&          j        k    rx| j        5  t1          | j                             ¦   «         ¦  «        }
d d d ¦  «         n# 1 swxY w Y   |
D ]}|                     |	¦  «         Œ d d d ¦  «         d d d ¦  «         d S |	d         t&          j        k    r?| j        5  d| _        d d d ¦  «         n# 1 swxY w Y    d d d ¦  «         d d d ¦  «         d S |	d         }| j        5  || j        vrt=          ¦   «         | j        |<   | j        |                              |	¦  «         |	d         t&          j        k    r| j          !                    |¦  «         t          | j         ¦  «        dk    o|dk    }|rd| _        d d d ¦  «         n# 1 swxY w Y   |r d d d ¦  «         d d d ¦  «         d S ntE          d|› d�¦  «        ‚d|v �°|�Œ‹	 d d d ¦  «         n# 1 swxY w Y   d d d ¦  «         d S # 1 swxY w Y   d S # tF          $ r?}tI          |t          j%        ¦  «        rY d }~d S dd l&}| '                    ¦   «          |‚d }~ww xY w)NrÂ   rÁ   rÑ   rÏ   r    )Úparamsr0   rI   ra   s   

r&   zutf-8ú
zdata:é   ÚmsgÚmessagerT   FÚevent_idr   Ússe_v3zUnexpected SSE line: 'ú'© )(r@   r×   rØ   rÙ   ÚTimeoutr.   r2   rÚ   rŽ   r0   rI   Ú
iter_bytesÚsplitÚdecoderˆ   Úlenrx   ÚjsonÚloadsr    r´   rY   Úserver_stoppedrº   Úlistr·   ÚvaluesÚappendÚclose_streamrµ   r   Úprocess_completedr¹   Údiscardru   ÚBaseExceptionro   ÚRemoteProtocolErrorÚ	tracebackÚ	print_exc)r^   rQ   r    r@   ræ   ré   ÚbufferÚchunkÚlineÚrespÚpendingÚpending_messagesr÷   rÆ   Úer  s                   r_   Ústream_messageszClient.stream_messages3  si  € ð
H	ØÔ,×1Ò1Ñ3Ô3ˆLØ×#Ò# I­u¬}ÀTÐ/JÑ/JÔ/JÑKÔKÐKÝ”ð ð Ø”ðàðð ð ;Sð Ø—]’]ØØ”LØ*¨LÐ9Ø œLØ œLð #ñ ô ð 7Sð Ø �FØ!)×!4Ò!4Ñ!6Ô!6ð /Sñ /S˜Ø %™˜Ø%¨Ð/Ñ/Ø+1¯<ª<¸ÀÑ+CÔ+C™L˜D &Ø#'§;¢;¨wÑ#7Ô#7×#>Ò#>¸tÑ#DÔ#D˜DÝ#& t¡9¤9ð )Ø (Ø#Ÿš¨wÑ7Ô7ñ (SÝ'+¤z°$°q°r°r´(Ñ';Ô'; Ø#'¨¤;µ-Ô2IÒ#IÐ#IØ$,à$(§H¢H¨Y¸Ñ$;Ô$;Ý'4Ô'Cò%Dð %Dð *.Ô):ð %*ð %*Ý26Ø,0Ô,K×,RÒ,RÑ,TÔ,Tñ3*ô 3*¨ð%*ð %*ð %*ñ %*ô %*ð %*ð %*ð %*ð %*ð %*ð %*øøøð %*ð %*ð %*ð %*ð =Dð %Fð %FÐ(8Ø(8×(?Ò(?ÀÑ(EÔ(EÐ(EÐ(EØ$*ð;7Sð 7Sð 7Sñ 7Sô 7Sð 7Sð	;Sð ;Sð ;Sñ ;Sô ;Sð ;Sð ;Sð ;SðD &*¨%¤[µMÔ4NÒ%NÐ%NØ)-Ô):ð %Að %AØ;@¨Ô(8ð%Að %Að %Añ %Aô %Að %Að %Að %Að %Að %Að %Aøøøð %Að %Að %Að %Aà$*ðC7Sð 7Sð 7Sñ 7Sô 7Sð 7Sð	;Sð ;Sð ;Sñ ;Sô ;Sð ;Sð ;Sð ;SðL ,0°
Ô+; Ø%)Ô%6ð !Að !AØ'/°tÔ7VÐ'VÐ'Vå,1©G¬Gð )-Ô(GÈÑ(Qð %)Ô$CÀHÔ$M×$TÒ$TØ(,ñ%&ô %&ð %&ð (,¨E¤{µmÔ6UÒ'UÐ'Uà(,Ô(>×(FÒ(FÀxÑ(PÔ(PÐ(På(+¨DÔ,BÑ(CÔ(CÀqÒ(Hð )AØ,4¸Ò,@ð %*ð (-ð %AØ;@¨Ô(8ð!!Að !Að !Añ !Aô !Að !Að !Að !Að !Að !Að !Aøøøð !Að !Að !Að !Að" $)ð !+Ø$*ðk7Sð 7Sð 7Sñ 7Sô 7Sð 7Sð	;Sð ;Sð ;Sñ ;Sô ;Sð ;Sð ;Sð ;Sðp!+õ '1Ð1QÈ$Ð1QÐ1QÐ1QÑ&RÔ&RÐ Rð[ &¨Ð/Ñ/ùð/Sð7Sð 7Sð 7Sñ 7Sô 7Sð 7Sð 7Sð 7Sð 7Sð 7Sð 7Søøøð 7Sð 7Sð 7Sð 7Sð	;Sð ;Sð ;Sñ ;Sô ;Sð ;Sð ;Sð ;Sð ;Sð ;Sð ;Sð ;Søøøð ;Sð ;Sð ;Sð ;Sð ;Sð ;Søõx ð 		ð 		ð 		õ ˜!�UÔ6Ñ7Ô7ð Ø�����ØÐÐÐà×ÒÑ!Ô!Ð!ØˆGøøøøð		øøøs
  ‚AM Á,MÂC)L7Å1'F$	ÆL7Æ$F(Æ(L7Æ+F(Æ,L7Ç
MÇM Ç"L7Ç?H	ÈL7ÈHÈL7ÈHÈL7ÈMÈ*M È7L7ÉBK)	ËL7Ë)K-Ë-L7Ë0K-Ë1L7Ë7MÌM ÌL7Ì+MÌ7L;	Ì;MÌ>L;	Ì?MÍM ÍMÍM ÍMÍM Í
N%Í&N ÎN Î N%c                óà  ‡ ‡‡‡‡— ‰                       ‰ j        ¦  «        }|�i |¥|¥}t          j        ‰ j        fi |¥‰¥|‰ j        ‰ j        dœ‰ j        ¤Ž}|j        dk    rt          d¦  «        ‚t          j        |¦  «        x}�t          |¦  «        ‚|                     ¦   «          |                     ¦   «         }|d         }	‰ j        5  ‰ j         }
|
rd‰ _        ‰ xj        dz  c_        ‰ j        Š‰ j                             |	¦  «         ‰ j                             |	t-          ¦   «         ¦  «         ‰‰ j        |	<   t1          ‰ j        ¦  «        Š‰ xj        ‰z  c_        ˆfd„‰ j                             ¦   «         D ¦   «         ‰ _        d d d ¦  «         n# 1 swxY w Y   |
rFˆˆˆ fd„}ˆˆ fd	„}‰ j                             |¦  «        ‰ _        ‰ j                             |¦  «         |	S )
N©r   r0   rI   rÑ   i÷  z Queue is full! Please try again.r÷   Tr&   c                ó$   •— i | ]\  }}|‰v ¯	||“ŒS rú   rú   )r[   ÚeidÚtaggedÚlives      €r_   r`   z$Client.send_data.<locals>.<dictcomp>§  s0   ø€ ð (ð (ð (á�C˜Ø˜$�;�;ð �Và�;�;ra   c                 ó>   •— ‰                      ‰‰ d         ¬¦  «        S )Nr    rÍ   )r  )Ú	hash_datarQ   r^   s   €€€r_   Úopen_streamz%Client.send_data.<locals>.open_stream¯  s*   ø€ Ø×+Ò+Ø¨9°^Ô+Dð ,ñ ô ð ra   c                ó
  •— ‰j         5  ‰j        | u rd ‰_        ‰j        ‰k    rd‰_        ˆˆfd„‰j                             ¦   «         D ¦   «         }d d d ¦  «         n# 1 swxY w Y   |D ]}|                     d ¦  «         Œd S )NFc                ó^   •— g | ])\  }}‰j                              |‰d z   ¦  «        ‰k    ¯'|‘Œ*S )r&   )r¼   rY   )r[   r  ÚmessagesÚepochr^   s      €€r_   ú
<listcomp>z:Client.send_data.<locals>.close_stream.<locals>.<listcomp>¼  sI   ø€ ð ð ð á)˜C ØÔ3×7Ò7¸¸UÀQ¹YÑGÔGÈ5ÒPÐPð !àPÐPÐPra   )rº   r¶   r»   rµ   r·   Úitemsr  )Úfuturer  r  r!  r^   s      €€r_   r  z&Client.send_data.<locals>.close_stream´  sþ   ø€ ØÔ&ð ð ØÔ,°Ð6Ð6Ø04˜Ô-ØÔ(¨EÒ1Ð1ð ,1˜Ô(ðð ð ð ð à-1Ô-L×-RÒ-RÑ-TÔ-Tðñ ô �Gðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð )0ð 2ð 2Ð$Ø$×+Ò+¨DÑ1Ô1Ð1Ð1ð2ð 2s   ‰A	AÁA"Á%A")Úadd_zero_gpu_headersr0   rÙ   Úpostr“   rI   r2   r@   rÜ   r   r   Úextract_validation_messager   Úraise_for_statusr   rº   rµ   r»   r¹   Úaddr·   rØ   r   r¼   r¸   r#  r¨   r*   r¶   Úadd_done_callback)r^   Údatar  rQ   Úrequest_headersr0   ÚreqÚvalidation_messager  r÷   Úopen_readerr  r  r!  r  s   ` ``         @@r_   Ú	send_datazClient.send_data‚  s¡  øøøøø€ Ø×+Ò+¨D¬LÑ9Ô9ˆØÐ&Ø4˜Ð4¨GÐ4ˆGÝŒjØÔð
à&�DÐ&˜IÐ&ØØ”LØ”?ð
ð 
ð Ôð
ð 
ˆð Œ?˜cÒ!Ð!ÝÐ?Ñ@Ô@Ð@Ý"'Ô"BÀ3Ñ"GÔ"GÐGÐÐTÝ!Ð"4Ñ5Ô5Ð5Ø×ÒÑÔÐØ�xŠx‰zŒzˆØ˜
Ô#ˆð Ôð 	ð 	Ø"Ô.Ð.ˆKØð 'Ø#'�Ô ØÐ!Ô! QÑ&Ð!Ô!ØÔ%ˆEØÔ"×&Ò& xÑ0Ô0Ð0ØÔ+×6Ò6°xÅÁÄÑIÔIÐIØ16ˆDÔ$ XÑ.õ �tÔ6Ñ7Ô7ˆDØÐ"Ô" dÑ*Ð"Ô"ð(ð (ð (ð (à#'Ô#;×#AÒ#AÑ#CÔ#Cð(ñ (ô (ˆDÔ$ð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð& ð 	Bðð ð ð ð ð ð ð
2ð 2ð 2ð 2ð 2ð 2ð$ %)Ô$8×$?Ò$?ÀÑ$LÔ$LˆDÔ!ØÔ!×3Ò3°LÑAÔAÐAàˆs   ÃCFÆFÆ"Frô   Úfrom_idÚto_idÚprivateÚhardwareú}Literal['cpu-basic', 'cpu-upgrade', 't4-small', 't4-medium', 'a10g-small', 'a10g-large', 'a100-large'] | SpaceHardware | NoneÚsecretsÚsleep_timeoutc
           	     óº  — 	 t          j        ||¬¦  «        }
n&# t          $ r}t          d|› d�¦  «        |‚d}~ww xY w|r6d|v r|                     d¦  «        d         }t          j        ||¬¦  «        }n/t          j        |                     d¦  «        d         |¬¦  «        }	 t          j        ||¬¦  «         |	r0t          dt          j         	                    |¦  «        › d�¦  «         |�t          j        d	¦  «         nŸ# t          $ r’ |	rt          d
|› d�¦  «         t          j        ||d|d|¬¦  «         |�- |j        ¦   «         D ]\  }}t          j        ||||¬¦  «         Œ|	r/t          dt          j         	                    |¦  «        › �¦  «         Y nw xY wt          j        ||¬¦  «        }|j        pt           j        j        }|p|
j        }||k    r*t          j        |||¬¦  «         t          d|› d�¦  «         |t           j        j        k    rt          j        |||dz  ¬¦  «         |	rt          d¦  «          | ||||	¬¦  «        }|S )a_
  
        Duplicates a Hugging Face Space under your account and returns a Client object
        for the new Space. No duplication is created if the Space already exists in your
        account (to override this, provide a new name for the new Space using `to_id`).
        To use this method, you must provide an `token` or be logged in via the Hugging
        Face Hub CLI.

        The new Space will be private by default and use the same hardware as the original
        Space. This can be changed by using the `private` and `hardware` parameters. For
        hardware upgrades (beyond the basic CPU tier), you may be required to provide
        billing information on Hugging Face: https://huggingface.co/settings/billing

        Parameters:
            from_id: The name of the Hugging Face Space to duplicate in the format "{username}/{space_id}", e.g. "gradio/whisper".
            to_id: The name of the new Hugging Face Space to create, e.g. "abidlabs/whisper-duplicate". If not provided, the new Space will be named "{your_HF_username}/{space_id}".
            token: optional Hugging Face token to use to duplicating private Spaces. By default, no token is sent to the server. Set `token=None` to use the locally saved token if there is one. Find your tokens here: https://huggingface.co/settings/tokens.
            private: Whether the new Space should be private (True) or public (False). Defaults to True.
            hardware: The hardware tier to use for the new Space. Defaults to the same hardware tier as the original Space. Options include "cpu-basic", "cpu-upgrade", "t4-small", "t4-medium", "a10g-small", "a10g-large", "a100-large", subject to availability.
            secrets: A dictionary of (secret key, secret value) to pass to the new Space. Defaults to None. Secrets are only used when the Space is duplicated for the first time, and are not updated if the duplicated Space already exists.
            sleep_timeout: The number of minutes after which the duplicate Space will be puased if no requests are made to it (to minimize billing charges). Defaults to 5 minutes.
            max_workers: The maximum number of thread workers that can be used to make requests to the remote Gradio app simultaneously.
            verbose: Whether the client should print statements to the console.
        Example:
            import os
            from gradio_client import Client
            HF_TOKEN = os.environ.get("HF_TOKEN")
            client = Client.duplicate("abidlabs/whisper", token=HF_TOKEN)
            client.predict("audio_sample.wav")
            >> "This is a test of the whisper speech recognition model."
        ©r8   rO   z5. If it is a private Space, please provide a `token`.NrN   r&   zUsing your existing Space: u    ðŸ¤—z‚Secrets are only used when the Space is duplicated for the first time, and are not updated if the duplicated Space already exists.zCreating a duplicate of u    for your own use... ðŸ¤—ÚspaceT)r1  r2  Ú	repo_typer8   rK   r3  zCreated new Space: z1-------
NOTE: this Space uses upgraded hardware: zG... see billing info at https://huggingface.co/settings/billing
-------r'   )r8   Útimeout_in_secondsrT   )r8   r:   r<   )Úhuggingface_hubÚget_space_runtimer   ru   rý   Úget_full_repo_namer}   r   Ú	SPACE_URLrÖ   ÚwarningsÚwarnÚduplicate_repor#  Úadd_space_secretr4  r   Ú	CPU_BASICÚrequest_space_hardwareÚset_space_timeout)Úclsr1  r2  r8   r3  r4  r6  r7  r:   r<   Úoriginal_infoÚrnferk   ÚkeyÚvalueÚcurrent_infoÚcurrent_hardwareræ   s                     r_   r,   zClient.duplicateË  s   € ðj	Ý+Ô=¸gÈUÐSÑSÔSˆMˆMøÝ&ð 	ð 	ð 	ÝØg¨ÐgÐgÐgñô àðøøøøð	øøøð ð 	Ø�eˆ|ˆ|ØŸš CÑ(Ô(¨Ô+�Ý&Ô9¸%ÀuÐMÑMÔMˆHˆHå&Ô9Ø—’˜cÑ"Ô" 1Ô%¨Uðñ ô ˆHð	PÝÔ-¨h¸eÐDÑDÔDÐDØð ÝØYµ%´/×2HÒ2HÈÑ2RÔ2RÐYÐYÐYñô ð ð Ð"Ý”ð Yñô ð øøõ 'ð 	Pð 	Pð 	PØð UÝÐS°ÐSÐSÐSÑTÔTÐTÝÔ*ØØØ!ØØØðñ ô ð ð Ð"Ø"/ '¤-¡/¤/ð Xð X‘J�C˜Ý#Ô4°X¸sÀEÐQVÐWÑWÔWÐWÐWØð PÝÐN­E¬O×,BÒ,BÀ8Ñ,LÔ,LÐNÐNÑOÔOÐOøøð	Pøøøõ  'Ô8¸ÈÐOÑOÔOˆàÔ!ÐL¥_Ô%BÔ%Lð 	ð Ð5˜}Ô5ˆØ˜xÒ'Ð'ÝÔ2°8¸XÈUÐSÑSÔSÐSÝð XÀXð  Xð  Xð  Xñô ð ð
 •Ô4Ô>Ò>Ð>ÝÔ#Ø ¸-È"Ñ:Lðñ ô ð ð ð 	Ý�"‰IŒIˆIØ��X U¸ÈWÐUÑUÔUˆØˆs$   ‚ ™
<£7·<Â'AD ÄBF"Æ!F"c                ób   — | j         sd S t          j        | j         | j        ¬¦  «        }|j        S ©Nr9  )rk   r=  r>  r8   Ústage)r^   Úinfos     r_   r{   zClient._get_space_state=  s2   € ØŒ}ð 	Ø�4ÝÔ0°´ÀdÄjÐQÑQÔQˆØŒzÐra   ©Úapi_namer\   r0   rT  r\   ú
int | Noner   c               óH   —  | j         ||||dœ|¤Ž                     ¦   «         S )aC  
        Calls the Gradio API and returns the result (this is a blocking call). Arguments can be provided as positional arguments or as keyword arguments (latter is recommended).

        Parameters:
            args: The positional arguments to pass to the remote API endpoint. The order of the arguments must match the order of the inputs in the Gradio app.
            api_name: The name of the API endpoint to call starting with a leading slash, e.g. "/predict". Does not need to be provided if the Gradio app has only one named API endpoint.
            fn_index: As an alternative to api_name, this parameter takes the index of the API endpoint to call, e.g. 0. Both api_name and fn_index can be provided, but if they conflict, api_name will take precedence.
            kwargs: The keyword arguments to pass to the remote API endpoint.
            headers: Additional headers to send to the remote Gradio app on this request. This parameter will overrides the headers provided in the Client constructor if they have the same keys.
        Returns:
            The result of the API call. Will be a Tuple if the API has multiple outputs.
        Example:
            from gradio_client import Client
            client = Client(src="gradio/calculator")
            client.predict(5, "add", 4, api_name="/predict")
            >> 9.0
        rS  )r*   Úresult)r^   rT  r\   r0   rg   Úkwargss         r_   r)   zClient.predictC  s9   € ð2 ˆtŒ{Ø˜H¨xÀð
ð 
ØLRð
ð 
ç
Š&‰(Œ(ð	ra   r   c                ó„   — t          t          ¦   «         t          ¦   «         | j        |         j        | j        |¬¦  «        S )N)r,  )r   r   r   r¢   Úprocess_predictionsrš   )r^   r\   r0   s      r_   Ú
new_helperzClient.new_helper`  s>   € õ Ý‰FŒFÝ‰KŒKØŒN˜8Ô$Ô8ØŒNØ#ð
ñ 
ô 
ð 	
ra   )rT  r\   r0   Úresult_callbacksr\  ú Callable | list[Callable] | NoneÚJobc               óŽ  — |                       ||¦  «        }| j        |         }t          |t          ¦  «        rt	          j        |j        ||¦  «        }d}	|j        dv r6|pi }d|d<   |                      ||¬¦  «        }	| 	                    |	¦  «        }
nt          d|j        z   ¦  «        ‚ | j        j        t          ¦   «         j        |
g|¢R Ž }|                     |	¦  «        }t!          ||	| j        | j        |¬¦  «        }|r?t          |t&          ¦  «        r|g}dd
„}|D ] }|                      ||¦  «        ¦  «         Œ!|S )aP  
        Creates and returns a Job object which calls the Gradio API in a background thread. The job can be used to retrieve the status and result of the remote API call.
         Arguments can be provided as positional arguments or as keyword arguments (latter is recommended).

        Parameters:
            args: The arguments to pass to the remote API. The order of the arguments must match the order of the inputs in the Gradio app.
            api_name: The name of the API endpoint to call starting with a leading slash, e.g. "/predict". Does not need to be provided if the Gradio app has only one named API endpoint.
            fn_index: As an alternative to api_name, this parameter takes the index of the API endpoint to call, e.g. 0. Both api_name and fn_index can be provided, but if they conflict, api_name will take precedence.
            result_callbacks: A callback function, or list of callback functions, to be called when the result is ready. If a list of functions is provided, they will be called in order. The return values from the remote API are provided as separate parameters into the callback. If None, no callback will be called.
            kwargs: The keyword arguments to pass to the remote API endpoint.
            headers: Additional headers to send to the remote Gradio app on this request. This parameter will overrides the headers provided in the Client constructor if they have the same keys.
        Returns:
            A Job object that can be used to retrieve the status and result of the remote API call.
        Example:
            from gradio_client import Client
            client = Client(src="gradio/calculator")
            job = client.submit(5, "add", 4, api_name="/predict")
            job.status()
            >> <Status.STARTING: 'STARTING'>
            job.result()  # blocking call
            >> 9.0
        N)rU   Ússe_v1Ússe_v2ússe_v2.1rø   Úapizx-gradio-user)r0   zUnknown protocol: )Úcommunicatorr<   rk   Ú
_cancel_fnrï   r   c                ó   ‡ — ˆ fd„}|S )Nc                óÂ   •— t          |                      ¦   «         t          ¦  «        r ‰|                      ¦   «         Ž  d S  ‰|                      ¦   «         ¦  «         d S ©N)ro   rW  Útuple)r$  Úcallbacks    €r_   Úfnz,Client.submit.<locals>.create_fn.<locals>.fn°  sV   ø€ Ý! &§-¢-¡/¤/µ5Ñ9Ô9ð 2Ø ˜ &§-¢-¡/¤/Ð2Ð2Ð2Ð2à ˜ §¢¡¤Ñ1Ô1Ð1Ð1Ð1ra   rú   )rj  rk  s   ` r_   Ú	create_fnz Client.submit.<locals>.create_fn¯  s#   ø€ ð2ð 2ð 2ð 2ð 2ð �	ra   )rï   r   )Ú_infer_fn_indexr¢   ro   rZ   r   Úconstruct_argsÚparameters_inforQ   r[  Úmake_end_to_end_fnru   r¦   r*   r   ÚrunÚmake_cancelr^  r<   rk   r   r*  )r^   rT  r\   r0   r\  rg   rX  Úinferred_fn_indexÚendpointÚhelperÚend_to_end_fnr$  Ú	cancel_fnÚjobrl  rj  s                   r_   r*   zClient.submitk  s’  € ð> !×0Ò0°¸8ÑDÔDÐà”>Ð"3Ô4ˆå�h¥Ñ)Ô)ð 	PÝÔ'¨Ô(@À$ÈÑOÔOˆDàˆØÔð !
ð 
ð 
ð �m ˆGØ',ˆG�OÑ$Ø—_’_Ð%6À�_ÑHÔHˆFØ$×7Ò7¸Ñ?Ô?ˆMˆMåÐ1°HÔ4EÑEÑFÔFÐFØ%�”Ô%¥l¡n¤nÔ&8¸-ÐOÈ$ÐOÐOÐOˆà×(Ò(¨Ñ0Ô0ˆ	åØØØ”LØ”]Ø ð
ñ 
ô 
ˆð ð 	;ÝÐ*­HÑ5Ô5ð 6Ø$4Ð#5Ð ðð ð ð ð -ð ;ð ;�Ø×%Ò% i i°Ñ&9Ô&9Ñ:Ô:Ð:Ð:àˆ
ra   c                ó\  — t           j                             | j        t          j        ¦  «        }| j        t          j        d¦  «        k    ret          j
        |f| j        | j        | j        dœ| j        ¤Ž}|j        r|                     ¦   «         }n¯t#          d| j        › d|j        › �¦  «        ‚t          j        t          j        ft!          j        | j        ¦  «        ddœ| j        | j        | j        dœ| j        ¤Ž}|j        r|                     ¦   «         d         }nt#          d| j        › d|j        › �¦  «        ‚i }i }|d	                              ¦   «         D ]S\  }}|                     d
d ¦  «         d|v r|                     d¦  «        dk    s|                     dd¦  «        r|||<   ŒT|d                              ¦   «         D ]S\  }	}|                     d
d ¦  «         d|v r|                     d¦  «        dk    s|                     dd¦  «        r|||	<   ŒT||d<   ||d	<   |S )Nz3.36.1rÐ   zCould not fetch api info for ú: F)rƒ   Ú	serializer  rc  Únamed_endpointsÚcode_snippetsÚapi_visibilityr3  Úshow_apiTÚunnamed_endpoints)r…   r†   r‡   r‰   r   ÚRAW_API_INFO_URLr›   r   ÚVersionrÙ   rY   r0   rI   r2   r@   rÝ   r   ru   r6   Útextr&  ÚSPACE_FETCHER_URLÚdumpsrƒ   r#  rn   )
r^   Úapi_info_urlÚrrR  Úfetchr|  r€  rT  rt  r\   s
             r_   rœ   zClient._get_api_info½  s~  € Ý”|×+Ò+¨DÔ,=½uÔ?UÑVÔVˆØÔ�gœo¨hÑ7Ô7Ò7Ð7Ý”	ØðàœØœØ”ð	ð ð
 Ô#ðð ˆAð Œ|ð WØ—v’v‘x”x��å Ð!UÀÄÐ!UÐ!UÈQÌVÐ!UÐ!UÑVÔVÐVå”JÝÔ'ð
õ #œj¨¬Ñ5Ô5Ø!&ðð ð œØœØ”ð
ð 
ð Ô#ð
ð 
ˆEð Ôð Ø—z’z‘|”| EÔ*��å ØL°D´HÐLÐLÀÄ
ÐLÐLñô ð ð ˆØÐØ"&Ð'8Ô"9×"?Ò"?Ñ"AÔ"Að 	5ð 	5ÑˆH�hØ�LŠL˜¨$Ñ/Ô/Ð/à  HÐ,Ð,Ø—L’LÐ!1Ñ2Ô2°iÒ?Ð?Ø—,’,˜z¨4Ñ0Ô0ð @à,4� Ñ)øØ"&Ð':Ô";×"AÒ"AÑ"CÔ"Cð 	7ð 	7ÑˆH�hØ�LŠL˜¨$Ñ/Ô/Ð/à  HÐ,Ð,Ø—L’LÐ!1Ñ2Ô2°iÒ?Ð?Ø—,’,˜z¨4Ñ0Ô0ð @à.6Ð! (Ñ+øØ$5ˆÐ Ñ!Ø"1ˆÐÑØˆra   Úall_endpointsúbool | NoneÚ
print_infoÚreturn_formatúLiteral['dict', 'str'] | Noneúdict | str | Nonec                ó,  — t          | j        d         ¦  «        }t          | j        d         ¦  «        }|dk    r|€d}d}|d|› d�z  }| j        d                              ¦   «         D ]\  }}||                      ||¦  «        z  }Œ|rU|d	|› d�z  }| j        d                              ¦   «         D ]+\  }	}||                      t	          |	¦  «        |¦  «        z  }Œ,n|dk    r	|d	|› d
�z  }|rt          |¦  «         |dk    r|S |dk    r| j        S dS )a‡  
        Prints the usage info for the API. If the Gradio app has multiple API endpoints, the usage info for each endpoint will be printed separately. If return_format="dict" the info is returned in dictionary format, as shown in the example below.

        Parameters:
            all_endpoints: If True, prints information for both named and unnamed endpoints in the Gradio app. If False, will only print info about named endpoints. If None (default), will print info about named endpoints, unless there aren't any -- in which it will print info about unnamed endpoints.
            print_info: If True, prints the usage info to the console. If False, does not print the usage info.
            return_format: If None, nothing is returned. If "str", returns the same string that would be printed to the console. If "dict", returns the usage info as a dictionary that can be programmatically parsed, and *all endpoints are returned in the dictionary* regardless of the value of `all_endpoints`. The format of the dictionary is in the docstring of this method.
        Example:
            from gradio_client import Client
            client = Client(src="gradio/calculator")
            client.view_api(return_format="dict")
            >> {
                'named_endpoints': {
                    '/predict': {
                        'parameters': [
                            {
                                'label': 'num1',
                                'python_type': 'int | float',
                                'type_description': 'numeric value',
                                'component': 'Number',
                                'example_input': '5'
                            },
                            {
                                'label': 'operation',
                                'python_type': 'str',
                                'type_description': 'string value',
                                'component': 'Radio',
                                'example_input': 'add'
                            },
                            {
                                'label': 'num2',
                                'python_type': 'int | float',
                                'type_description': 'numeric value',
                                'component': 'Number',
                                'example_input': '5'
                            },
                        ],
                        'returns': [
                            {
                                'label': 'output',
                                'python_type': 'int | float',
                                'type_description': 'numeric value',
                                'component': 'Number',
                            },
                        ]
                    },
                    '/flag': {
                        'parameters': [
                            ...
                            ],
                        'returns': [
                            ...
                            ]
                        }
                    }
                }
                'unnamed_endpoints': {
                    2: {
                        'parameters': [
                            ...
                            ],
                        'returns': [
                            ...
                            ]
                        }
                    }
                }
            }

        r|  r€  r   NTz8Client.predict() Usage Info
---------------------------
zNamed API endpoints: ró   z
Unnamed API endpoints: z3, to view, run Client.view_api(all_endpoints=True)
r7   rm   )rÿ   r�   r#  Ú_render_endpoints_infor;   r}   )
r^   r‰  r‹  rŒ  Únum_named_endpointsÚnum_unnamed_endpointsÚ
human_inforT  Úendpoint_infor\   s
             r_   r+   zClient.view_apiñ  s‘  € õX " $¤*Ð->Ô"?Ñ@Ô@ÐÝ # D¤JÐ/BÔ$CÑ DÔ DÐØ !Ò#Ð#¨Ð(=Ø ˆMàQˆ
ØÐEÐ.AÐEÐEÐEÑEˆ
à'+¤zÐ2CÔ'D×'JÒ'JÑ'LÔ'Lð 	Oð 	OÑ#ˆH�mØ˜$×5Ò5°hÀÑNÔNÑNˆJˆJàð 	BØÐOÐ6KÐOÐOÐOÑOˆJØ+/¬:Ð6IÔ+J×+PÒ+PÑ+RÔ+Rð Xð XÑ'�˜-ð ˜d×9Ò9½#¸h¹-¼-ÈÑWÔWÑW�
�
ðXð # QÒ&Ð&Øð  BÐ6Kð  Bð  Bð  Bñ  BˆJàð 	Ý�*ÑÔÐØ˜EÒ!Ð!ØÐØ˜fÒ$Ð$Ø”:Ðð %Ð$ra   c                ó‚   — t          t          j        ¦   «         ¦  «        | _        | j                             ¦   «          d S rh  )r7   rž   rŸ   r    r¯   r¸   rÅ   s    r_   Úreset_sessionzClient.reset_sessionX  s3   € Ý¥¤
¡¤Ñ-Ô-ˆÔØÔ×#Ò#Ñ%Ô%Ð%Ð%Ð%ra   údict[str, str]c                óÖ   — | j         s|S 	 ddlm} n# t          $ r |cY S w xY w|j                             d¦  «        }|r)t          |d¦  «        rd|j        v r|j        d         |d<   |S )a  
        Adds the x-ip-token header to the headers dictionary to pass it to a Zero-GPU Space. This allows a user's
        ZeroGPU quota to be tracked and used by the underlying Space. For the x-ip-token header to be present,
        this method needs to be called when a Gradio app's LocalContext is defined. i.e. this method needs to be called
        when a Gradio app's LocalContext is defined. i.e. must be called from inside a Gradio app's
        event listener function or will not have any effect.
        r   )ÚLocalContextNr0   z
x-ip-token)rk   Úgradio.contextr™  ÚImportErrorÚrequestrY   Úhasattrr0   )r^   r0   r™  rœ  s       r_   r%  zClient.add_zero_gpu_headers\  s¨   € ð Œ}ð 	ØˆNð	Ø3Ð3Ð3Ð3Ð3Ð3Ð3øåð	ð 	ð 	ð ˆNˆNˆNð	øøøð Ô&×*Ò*¨4Ñ0Ô0ˆØð 	B•w˜w¨	Ñ2Ô2ð 	B°|ÀwÄÐ7VÐ7VØ$+¤O°LÔ$AˆG�LÑ!Øˆs   ‹ ’! !Úname_or_indexú	str | intÚendpoints_infoúdict[str, list[ParameterInfo]]c                ó$  — |d         }d„ |D ¦   «         }d„ |D ¦   «         }d                      |¦  «        }|r|dz   }d„ |d         D ¦   «         }d„ |D ¦   «         }d                      |¦  «        }t          |¦  «        dk    rd	|› d
�}t          |t          ¦  «        rd|› d�}n*t          |t          ¦  «        rd|› �}nt          d¦  «        ‚d|› |› d|› d�}	|                     d¦  «        r|	d|d         › d�z  }	|	dz  }	|rü|D ]ø}
|
d                              d¦  «        rd|
d         d         › d
�nd}|
                     d¦  «        }t          j        |d„ t          j	        ¦  «        }|
                     dd¦  «        sdnd|› d
�}|
d         d          }|
                     dd¦  «        r|€|d!z  }|	d"|
d#         › d$t          j
        |
                     d%¦  «        p|
d&         ¦  «        › d'|› d(|› d(|› d)�z  }	Œùn|	d*z  }	|	d+z  }	|d         rx|d         D ]n}
|
d                              d¦  «        rd|
d         d         › d
�nd}|
d         d          }|	d"|
d#         › d$t          j
        |
d&         ¦  «        › d'|› |› d)�z  }	Œon|	d*z  }	|	S ),NÚ
parametersc                óH   — g | ]}|                      d ¦  «        p|d         ‘Œ S )Úparameter_nameÚlabel)rY   ©r[   Úps     r_   r"  z1Client._render_endpoints_info.<locals>.<listcomp>w  s;   € ð 
ð 
ð 
Ø67ˆA�EŠEÐ"Ñ#Ô#Ð1 q¨¤zð
ð 
ð 
ra   c                ó6   — g | ]}t          j        |¦  «        ‘ŒS rú   ©r   Úsanitize_parameter_namesr§  s     r_   r"  z1Client._render_endpoints_info.<locals>.<listcomp>z  s#   € ÐVÐVÐVÀ�5Ô9¸!Ñ<Ô<ÐVÐVÐVra   ú, c                ó   — g | ]
}|d          ‘ŒS )r¦  rú   r§  s     r_   r"  z1Client._render_endpoints_info.<locals>.<listcomp>~  s   € ÐGÐGÐG¨˜˜7œÐGÐGÐGra   Úreturnsc                ó6   — g | ]}t          j        |¦  «        ‘ŒS rú   rª  )r[   r‡  s     r_   r"  z1Client._render_endpoints_info.<locals>.<listcomp>  s#   € ÐRÐRÐR¸q�Ô7¸Ñ:Ô:ÐRÐRÐRra   r&   ú(ú)z
api_name="ú"z	fn_index=z)name_or_index must be a string or integerz
 - predict(z) -> ró   r5   zF    Acts on your behalf: this endpoint takes your Hugging Face token (z:). Pass it with Client(..., oauth_token=...) to grant it.
z    Parameters:
Úpython_typeÚdescriptionz (rT   Úparameter_defaultc                ó   — d| d         › d�S )Nzhandle_file("rç   z")rú   ©Úxs    r_   ú<lambda>z/Client._render_endpoints_info.<locals>.<lambda>�  s   € Ð:¨a°¬hÐ:Ð:Ð:€ ra   Úparameter_has_defaultFz
(required)z(not required, defaults to:   Útypez | Nonez     - [Ú	componentz] r¥  r¦  rz  ú z 
z     - None
z    Returns:
)rÄ   rÿ   ro   r7   r;   ru   rY   r   ÚtraverseÚis_file_obj_with_metar«  )r^   rž  r   Úparameter_infoÚparameter_namesÚrendered_parametersÚreturn_valuesÚrendered_return_valuesÚfinal_paramr“  rR  ÚdescÚdefault_valueÚdefault_infoÚtype_s                  r_   r�  zClient._render_endpoints_infoq  s  € ð
 (¨Ô5ˆð
ð 
Ø;Ið
ñ 
ô 
ˆð WÐVÀoÐVÑVÔVˆØ"Ÿiši¨Ñ8Ô8ÐØð 	=Ø"5¸Ñ"<ÐØGÐG¨^¸IÔ-FÐGÑGÔGˆØRÐRÀMÐRÑRÔRˆØ!%§¢¨=Ñ!9Ô!9ÐÝˆ}ÑÔ Ò!Ð!Ø%BÐ)?Ð%BÐ%BÐ%BÐ"å�m¥SÑ)Ô)ð 	JØ7 }Ð7Ð7Ð7ˆKˆKÝ˜¥sÑ+Ô+ð 	JØ5 mÐ5Ð5ˆKˆKåÐHÑIÔIÐIàfÐ%8Ðf¸+ÐfÐfÐLbÐfÐfÐfˆ
Ø×Ò˜mÑ,Ô,ð 	Øð?Ø(¨Ô7ð?ð ?ð ?ñˆJð
 	Ð)Ñ)ˆ
Øð 	*Ø&ð nð n�ð ˜MÔ*×.Ò.¨}Ñ=Ô=ðÐ>˜˜mÔ,¨]Ô;Ð>Ð>Ð>Ð>àð ð
 !%§¢Ð)<Ñ =Ô =�Ý %¤Ø!Ø:Ð:ÝÔ/ñ!ô !�ð  Ÿ8š8Ð$;¸UÑCÔCðK�L�LàJ¸-ÐJÐJÐJð ð
 ˜]Ô+¨FÔ3�Ø—8’8Ð3°UÑ;Ô;ð 'ÀÐ@UØ˜YÑ&�EØð  n¨¨kÔ):ð  nð  n½eÔ>\Ð]a×]eÒ]eÐfvÑ]wÔ]wð  ^IÐ{ð  AHô  |Iñ  ?Jô  ?Jð  nð  nð  NSð  nð  nð  Vbð  nð  nð  eið  nð  nð  nñ  n�
�
ð)nð, ˜/Ñ)ˆJØÐ&Ñ&ˆ
Ø˜)Ô$ð 
	*Ø& yÔ1ð @ð @�ð ˜MÔ*×.Ò.¨}Ñ=Ô=ðÐ>˜˜mÔ,¨]Ô;Ð>Ð>Ð>Ð>àð ð
 ˜]Ô+¨FÔ3�ØÐ¨¨kÔ):ÐÐ½eÔ>\Ð]aÐbiÔ]jÑ>kÔ>kÐÐÐotÐÐvzÐÐÐÑ�
�
ð@ð ˜/Ñ)ˆJàÐra   c                ó0   — |                       dd¬¦  «        S ©NFr7   )r‹  rŒ  ©r+   rÅ   s    r_   Ú__repr__zClient.__repr__º  ó   € Ø�}Š}¨¸Uˆ}ÑCÔCÐCra   c                ó0   — |                       dd¬¦  «        S rË  rÌ  rÅ   s    r_   Ú__str__zClient.__str__½  rÎ  ra   c                óv   — d| j         i}	 t          ddt          j        |¬¦  «         d S # t          $ r Y d S w xY w)Nr6   zpy_client/initiatedrE   )ÚtopicrF   rG   Ú
user_agent)r6   r   r   ri   Ú	Exception©r^   r+  s     r_   r¬   zClient._telemetry_threadÀ  sk   € ð �4”8ð
ˆð	ÝØ+Ø,Ý %Ô 1Øð	ñ ô ð ð ð øõ ð 	ð 	ð 	ØˆDˆDð	øøøs   ‹* ª
8·8c                óf  — d }|�¦t          | j        d         ¦  «        D ][\  }}|                     d¦  «        }|�|du s|                     d¦  «        dk    rŒ:d|z   |k    r|                     d|¦  «        } n0Œ\d|› d	�}|                     d¦  «        s|d
z  }t	          |¦  «        ‚n†|�1|}|| j        vs| j        |         j        st	          d|› d	�¦  «        ‚nSd„ | j                             ¦   «         D ¦   «         }t          |¦  «        dk    r|d         j	        }nt	          d¦  «        ‚|S )Nrb   rT  Fr~  r3  rN   rX   z(Cannot find a function with `api_name`: ú.z% Did you mean to use a leading slash?zInvalid function index: c                óR   — g | ]$}|j         r|j        �|j        �|j        dk    ¯"|‘Œ%S )NÚpublic)Úis_validrT  Ú
backend_fnr~  )r[   r  s     r_   r"  z*Client._infer_fn_index.<locals>.<listcomp>ë  sN   € ð ð ð àØ”:ðð ”JÐ*Ø”LÐ,ØÔ$¨Ò0Ð0ð ð
 1Ð0Ð0ra   r&   r   zYThis Gradio app might have multiple endpoints. Please specify an `api_name` or `fn_index`)
r¡   rƒ   rY   rx   ru   r¢   rÚ  r  rÿ   r\   )	r^   rT  r\   rs  ÚiÚdÚconfig_api_nameÚerror_messageÚvalid_endpointss	            r_   rm  zClient._infer_fn_indexÏ  s¡  € Ø ÐØÐÝ! $¤+¨nÔ"=Ñ>Ô>ð 0ð 0‘��1Ø"#§%¢%¨
Ñ"3Ô"3�ð $Ð+Ø&¨%Ð/Ð/Ø—u’uÐ-Ñ.Ô.°)Ò;Ð;àØ˜Ñ(¨HÒ4Ð4Ø()¯ª¨d°A©¬Ð%Ø�Eð 5ð !WÈ8Ð VÐ VÐ V�Ø×*Ò*¨3Ñ/Ô/ð MØ!Ð%LÑL�MÝ  Ñ/Ô/Ð/ð ð Ð!Ø (Ðà!¨¬Ð7Ð7Ø”~Ð&7Ô8ÔAð 8õ !Ð!G¸HÐ!GÐ!GÐ!GÑHÔHÐHð 8ð
ð àœ×.Ò.Ñ0Ô0ðñ ô ˆOõ �?Ñ#Ô# qÒ(Ð(Ø$3°AÔ$6Ô$?Ð!Ð!å Øoñô ð ð !Ð ra   c                ó^  — t          | d¦  «        r| j                             ¦   «          t          | d¦  «        r| j                             d¬¦  «         t          | d¦  «        r| j                             d¬¦  «         t          | d¦  «        r| j                             d¬¦  «         d S d S )Nr°   r¦   F)râ   r§   r¨   )r�  r°   r¸   r¦   Úshutdownr§   r¨   rÅ   s    r_   Ú__del__zClient.__del__û  sÁ   € Ý�4Ð*Ñ+Ô+ð 	'ØÔ ×$Ò$Ñ&Ô&Ð&õ �4˜Ñ$Ô$ð 	/ØŒM×"Ò"¨Ð"Ñ.Ô.Ð.Ý�4Ð*Ñ+Ô+ð 	6ØÔ ×)Ò)¨uÐ)Ñ5Ô5Ð5Ý�4Ð*Ñ+Ô+ð 	6ØÔ ×)Ò)¨uÐ)Ñ5Ô5Ð5Ð5Ð5ð	6ð 	6ra   c                óx   — t          j        || j        ¬¦  «        }t          |j        ¦  «        | _        |j        S rP  )r=  Ú
space_infor8   r=   r3  rl   Úhost)r^   r:  rå  s      r_   rz   zClient._space_name_to_src  s4   € Ý$Ô/°¸T¼ZÐHÑHÔHˆ
Ý!% jÔ&8Ñ!9Ô!9ˆÔØŒÐra   útuple[str, str]c                ó�  — t          j        t          j                             | j        t          j        ¦  «        f|d         |d         dœ| j        dœ| j	        ¤Ž}|j
        s;|j        dk    rt          d| j        › d�¦  «        ‚t          d| j        › d�¦  «        ‚d	„ |j                             ¦   «         D ¦   «         | _        d
S )z‰
        Logs in to `utils.LOGIN_URL` using provided `auth` credentials.
        Warning: This method overwrites `self.cookies`.
        r   r&   )ÚusernameÚpassword)r+  rÑ   é‘  zCould not login to z. Invalid credentials.r×  c                ó   — i | ]
\  }}|®||“ŒS rh  rú   )r[   ÚnamerL  s      r_   r`   z!Client._login.<locals>.<dictcomp>  s*   € ð 
ð 
ð 
Ù'˜D %À5ÐCTˆD�%ÐCTÐCTÐCTra   N)rÙ   r&  r…   r†   r‡   r6   r   Ú	LOGIN_URLr2   r@   rÝ   rÜ   r   ru   rI   r#  )r^   r>   r  s      r_   r�   zClient._login  sê   € õ
 ŒzÝŒL× Ò  ¤­5¬?Ñ;Ô;ð
à" 1œg°4¸´7Ð;Ð;Ø”?ð
ð 
ð Ôð	
ð 
ˆð Œð 	DØÔ 3Ò&Ð&Ý)ØJ¨$¬(ÐJÐJÐJñô ð õ !Ð!B°t´xÐ!BÐ!BÐ!BÑCÔCÐCð
ð 
Ø+/¬<×+=Ò+=Ñ+?Ô+?ð
ñ 
ô 
ˆŒˆˆra   rm   c                óŠ  ‡ — t          j        t          j                             ‰ j        t          j        ¦  «        f‰ j        ‰ j	        ‰ j
        dœ‰ j        ¤Ž}|j        rSˆ fd„|j	                             ¦   «         D ¦   «         }‰ j	                             |¦  «         |                     ¦   «         S |j        dk    rt#          d‰ j        › d�¦  «        ‚|j        dk    rt          j        d¦  «        d ‚t          j        ‰ j        f‰ j        ‰ j	        ‰ j
        dœ‰ j        ¤Ž}|j        st'          d‰ j        › �¦  «        ‚t)          j        d	|j        ¦  «        }	 t          j        |                     d
¦  «        ¦  «        }n*# t2          $ r}t'          d‰ j        › �¦  «        |‚d }~ww xY wd|v rt'          d¦  «        ‚|S )NrÐ   c                ó2   •— i | ]\  }}|®|‰j         v¯||“ŒS rh  )rI   )r[   rí  rL  r^   s      €r_   r`   z&Client._get_config.<locals>.<dictcomp>0  s;   ø€ ð ð ð á�D˜%ØÐ$¨°T´\Ð)AÐ)Að �eà)AÐ)AÐ)Ara   rë  zCould not load z0 as credentials were not provided. Please login.rÒ   z5Too many requests to the API, please try again later.zCould not fetch config for z+window.gradio_config = (.*?);[\s]*</script>r&   z"Could not get Gradio config from: Úallow_flaggingzcGradio 2.x is not supported by this client. Please upgrade your Gradio app to Gradio 3.x or higher.)rÙ   rY   r…   r†   r‡   r6   r   Ú
CONFIG_URLr0   rI   r2   r@   rÝ   r#  rj   r   rÜ   r   ÚTooManyRequestsErrorru   ÚreÚsearchrƒ  r  ÚgroupÚAttributeError)r^   r‡  Únew_cookiesrW  rƒ   Úaes   `     r_   r‚   zClient._get_config#  s  ø€ ÝŒIÝŒL× Ò  ¤­5Ô+;Ñ<Ô<ð
à”LØ”LØ”?ð	
ð 
ð
 Ôð
ð 
ˆð Œ<ð *	ð
ð ð ð à#$¤9§?¢?Ñ#4Ô#4ðñ ô ˆKð
 ŒL×Ò Ñ,Ô,Ð,Ø—6’6‘8”8ˆOØŒ]˜cÒ!Ð!Ý%Ø\ $¤(Ð\Ð\Ð\ñô ð ð Œ]˜cÒ!Ð!ÝÔ,ØGñô àðõ ”	Ø”ðàœØœØ”ð	ð ð
 Ô#ðð ˆAð ”<ð KÝ Ð!I¸t¼xÐ!IÐ!IÑJÔJÐJå”YÐMÈqÌvÑVÔVˆFðÝœ F§L¢L°¡O¤OÑ4Ô4��øÝ!ð ð ð Ý ØC¸¼ÐCÐCñô àðøøøøðøøøð   6Ð)Ð)Ý Øyñô ð ð ˆMs   Å'F Æ
F-ÆF(Æ(F-)Nr/   TNN)r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   r0   rB   r1   rC   r2   r=   r3   r=   r4   r=   r5   r9   )rÇ   rÈ   rÉ   rÊ   rË   rÊ   )rQ   rî   r    r7   rï   rð   )NNTNNrô   r/   T)r1  r7   r2  r9   r8   r9   r3  r=   r4  r5  r6  rB   r7  r;   r:   r;   r<   r=   )rT  r9   r\   rU  r0   rB   rï   r   rh  )r\   r;   r0   rB   rï   r   )
rT  r9   r\   rU  r0   rB   r\  r]  rï   r^  )NTN)r‰  rŠ  r‹  r=   rŒ  r�  rï   rŽ  )rï   rð   )r0   r—  rï   r—  )rž  rŸ  r   r¡  rï   r7   )rT  r9   r\   rU  rï   r;   ©rï   r9   )r>   rç  )rï   rm   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rw   r¿   rÆ   Ústaticmethodr±   r  r0  Úclassmethodr,   r{   r)   r[  r*   rœ   r+   r–  r%  r�  rÍ  rÐ  r¬   rm  rã  rz   r�   r‚   rú   ra   r_   r.   r.   B   s²  € € € € € ðð ð& !ØØØ'+Ø.2ð^6ð *.Ø6FØØ!%Ø"&Ø"&ð^6ð ^6ð ^6ð ^6ð ^6ð ^6ð@+ð +ð +ð
 ð7Jð 7Jð 7Jñ „\ð7JðrMð Mð Mð Mð^Gð Gð GðR ð !Ø Øð Ø)-ØØØð)oð oð oð oñ „[ðoðbð ð ð  $Ø#Ø)-ðð ð ð ð ð ð< ?Cð	
ð 	
ð 	
ð 	
ð 	
ð  $Ø#Ø)-Ø=AðPð Pð Pð Pð Pð Pðd2ð 2ð 2ðl &*ØØ7;ð	eð eð eð eð eðN&ð &ð &ð &ðð ð ð ð*Gð Gð Gð GðRDð Dð DðDð Dð Dðð ð ð ð*!ð *!ð *!ð *!ðX6ð 6ð 6ðð ð ð ð

ð 
ð 
ð 
ð,2ð 2ð 2ð 2ð 2ð 2ra   r.   c                  ó.   — e Zd ZU ded<   ded<   ded<   dS )ÚComponentApiTyper=   ÚskipÚvalue_is_fileÚis_stateN©rû  rü  rý  Ú__annotations__rú   ra   r_   r  r  X  s.   € € € € € € à€J€J�JØÐÐÑØ€N€N�N€N€Nra   r  c                  ó   — e Zd ZU ded<   dS )Ú	ReplaceMer;   ÚindexNr  rú   ra   r_   r	  r	  _  s   € € € € € € à€J€J�J€J€Jra   r	  c                  ó  — e Zd ZdZ	 d=d>d„Zd?d„Zd@d„ZdAd„ZdBd„Ze	dCd„¦   «         Z
edDd„¦   «         Zej        dEd„¦   «         Zd„ Zd„ ZdFd„ZdGd!„ZdFd"„ZdHd$„ZdHd%„Zd&„ ZdHd'„ZdHd(„ZdId*„ZdJd.„ZdKd0„ZdLd3„ZdMd5„ZdNd8„ZdOd;„Zd<S )PrZ   zIHelper class for storing all the information about a single API endpoint.r`  ræ   r.   r\   r;   r]   rm   rQ   r7   c                óþ  ‡ — t          j        |¦  «        ‰ _        |‰ _        |‰ _        |                     d¦  «        }t          |t          ¦  «        rd|z   n|‰ _        ‰ j	        j
        ‰ _
        |‰ _        ˆ fd„|d         D ¦   «         ‰ _        ˆ fd„|d         D ¦   «         ‰ _        ‰                      ¦   «         ‰ _        ‰                      ¦   «         ‰ _        ‰ j	        j        ‰ _        |                     d¦  «        ‰ _        d|v r |d         d	k    ‰ _        |d         ‰ _        d S |                     d¦  «        d
u‰ _        ‰ j        s	d	‰ _        d S |                     d¦  «        d
u r	d‰ _        d S d‰ _        d S )NrT  rN   c                ó:   •— g | ]}‰                      |¦  «        ‘ŒS rú   ©Ú_get_component_type©r[   Úid_r^   s     €r_   r"  z%Endpoint.__init__.<locals>.<listcomp>s  s4   ø€ ð &
ð &
ð &
Ø.1ˆD×$Ò$ SÑ)Ô)ð&
ð &
ð &
ra   Úinputsc                ó:   •— g | ]}‰                      |¦  «        ‘ŒS rú   r  r  s     €r_   r"  z%Endpoint.__init__.<locals>.<listcomp>v  s4   ø€ ð '
ð '
ð '
Ø.1ˆD×$Ò$ SÑ)Ô)ð'
ð '
ð '
ra   ÚoutputsrÛ  r~  r3  Fr  ÚundocumentedrÙ  )r²   r³   Ú_clientr\   r]   rY   ro   r7   rT  ræ   r�   rQ   Úinput_component_typesÚoutput_component_typesÚ_get_parameters_inforo  Ú_get_oauth_token_requirementÚoauth_token_requirementr‰   Úroot_urlrÛ  rÚ  r~  )r^   ræ   r\   r]   rQ   rT  s   `     r_   r¿   zEndpoint.__init__g  sª  ø€ õ ”{ 6Ñ*Ô*ˆŒØ ˆŒØ$ˆŒØ—>’> *Ñ-Ô-ˆå(¨µ3Ñ7Ô7ÐEˆC�(‰NˆN¸Xð 	Œð ”[Ô&ˆŒ
Ø ˆŒð&
ð &
ð &
ð &
Ø5?ÀÔ5Ið&
ñ &
ô &
ˆÔ"ð'
ð '
ð '
ð '
Ø5?À	Ô5Jð'
ñ '
ô '
ˆÔ#ð  $×8Ò8Ñ:Ô:ˆÔØ'+×'HÒ'HÑ'JÔ'JˆÔ$ØœÔ0ˆŒØ$Ÿ.š.¨Ñ6Ô6ˆŒð ˜zÐ)Ð)Ø&Ð'7Ô8¸IÒEˆDŒMØ",Ð-=Ô">ˆDÔÐÐà&ŸNšN¨:Ñ6Ô6¸eÐCˆDŒMØ”=ð /Ø&/�Ô#Ð#Ð#Ø—’ 
Ñ+Ô+¨uÐ4Ð4Ø&4�Ô#Ð#Ð#à&.�Ô#Ð#Ð#ra   Úcomponent_idc                ó  ‡— t          ˆfd„| j        j        d         D ¦   «         ¦  «        }|                     d|d         t          j        v ¦  «        }t          ||                      |¦  «        |d         dk    ¦  «        S )Nc              3  ó4   •K  — | ]}|d          ‰k    ¯|V — ŒdS ©rX   Nrú   )r[   rÜ  r  s     €r_   ú	<genexpr>z/Endpoint._get_component_type.<locals>.<genexpr>Œ  s:   øè è € ð 
ð 
Ø¸1¸T¼7ÀlÒ;RÐ;RˆAÐ;RÐ;RÐ;RÐ;Rð
ð 
ra   Ú
componentsÚskip_apir»  r¾   )Únextræ   rƒ   rY   r   ÚSKIP_COMPONENTSr  r  )r^   r  r¼  r#  s    `  r_   r  zEndpoint._get_component_type‹  s—   ø€ Ýð 
ð 
ð 
ð 
Ø”{Ô)¨,Ô7ð
ñ 
ô 
ñ 
ô 
ˆ	ð —=’= ¨Y°vÔ->Å%ÔBWÐ-WÑXÔXˆÝØØ×Ò˜yÑ)Ô)Ø�fÔ Ò(ñ
ô 
ð 	
ra   rï   úlist[ParameterInfo] | Nonec                ój   — | j         | j        d         v r| j        d         | j                  d         S d S )Nr|  r£  )rT  r�   rÅ   s    r_   r  zEndpoint._get_parameters_info–  s6   € ØŒ=˜DœJÐ'8Ô9Ð9Ð9Ø”:Ð/Ô0°´Ô?ÀÔMÐMØˆtra   r9   c                ó„   — | j         | j        d         v r+| j        d         | j                                       d¦  «        S dS )zJReturns "required", "optional", or None for this endpoint's gr.OAuthToken.r|  r5   N)rT  r�   rY   rÅ   s    r_   r  z%Endpoint._get_oauth_token_requirement›  s?   € àŒ=˜DœJÐ'8Ô9Ð9Ð9Ø”:Ð/Ô0°´Ô?×CÒCÀMÑRÔRÐRØˆtra   r—  c                ó8   — | j         j        }|r| j        �d|iS i S )zSThe oauth_token body field, if this endpoint takes one and the caller supplied one.Nr5   )ræ   r5   r  )r^   r8   s     r_   Úoauth_token_payloadzEndpoint.oauth_token_payload¡  s,   € à”Ô'ˆØð 	*�TÔ1Ð=Ø! 5Ð)Ð)Øˆ	ra   r¼  r=   c                óB   — d| vrdS t          j        | d         ¦  «        S )NÚapi_infoF)r   r  )r¼  s    r_   r  zEndpoint.value_is_file¨  s*   € ð ˜YÐ&Ð&Ø�5ÝÔ" 9¨ZÔ#8Ñ9Ô9Ð9ra   c                óP   — |                       ¦   «         }|€t          d¦  «        ‚|S )Nz?The Client this endpoint belongs to has been garbage collected.)r  ru   ©r^   ræ   s     r_   ræ   zEndpoint.client²  s0   € à—’‘”ˆØˆ>ÝØQñô ð ð ˆra   rð   c                ó   ‡— ˆfd„| _         d S )Nc                 ó   •— ‰ S rh  rú   ©ræ   s   €r_   r¹  z!Endpoint.client.<locals>.<lambda>¾  s   ø€ ˜v€ ra   )r  r.  s    `r_   ræ   zEndpoint.client»  s   ø€ ð &�~�~�~ˆŒˆˆra   c                ó@   — d| j         j        › d| j        › d| j        › �S )NzEndpoint src: z, api_name: z, fn_index: )ræ   r6   rT  r\   rÅ   s    r_   rÍ  zEndpoint.__repr__À  s*   € Øg ¤¤ÐgÐg¸T¼]ÐgÐgÐX\ÔXeÐgÐgÐgra   c                ó*   — |                       ¦   «         S rh  )rÍ  rÅ   s    r_   rÐ  zEndpoint.__str__Ã  s   € Ø�}Š}‰ŒÐra   ru  r   c                óV   ‡ ‡‡‡— ‰                       ‰¦  «        Š‰ j        Šˆˆˆˆ fd„}|S )Nc                 ó.  •— ‰j         st          j        ¦   «         ‚‰j        r
 ‰j        | Ž }  ‰j        | Ž }  ‰| i |¤Ž} ‰j        |Ž }‰rJ‰j        5  ‰j        j	        s‰j        j	         
                    |¦  «         d d d ¦  «         n# 1 swxY w Y   |S rh  )rÚ  r   ÚInvalidAPIEndpointErrorr3   Úinsert_empty_stateÚprocess_input_filesrZ  Úlockrx  r  r  )r+  rX  ÚpredictionsÚ_predictræ   ru  r^   s      €€€€r_   Ú_innerz+Endpoint.make_end_to_end_fn.<locals>._innerÊ  sý   ø€ Ø”=ð 6ÝÔ3Ñ5Ô5Ð5àÔ&ð 6Ø.�tÔ.°Ð5�Ø+�4Ô+¨TÐ2ˆDØ"˜( DÐ3¨FÐ3Ð3ˆKØ2˜$Ô2°KÐ@ˆKð ð ?Ø”[ð ?ð ?Ø!œ:Ô-ð ?Øœ
Ô*×1Ò1°+Ñ>Ô>Ð>ð?ð ?ð ?ñ ?ô ?ð ?ð ?ð ?ð ?ð ?ð ?øøøð ?ð ?ð ?ð ?ð Ðs   Á,B
Â
BÂB)Úmake_predictræ   )r^   ru  r<  r;  ræ   s   `` @@r_   rp  zEndpoint.make_end_to_end_fnÆ  sO   øøøø€ Ø×$Ò$ VÑ,Ô,ˆØ”ˆð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð$ ˆra   úCommunicator | Nonec                óZ  ‡ ‡‡‡	‡
‡‡‡— ‰€d S ‰ j         Š
‰
j        t          j        d¦  «        k    r;t          j                             ‰
j        t          j	        ¦  «        Šˆ
ˆˆ fd„Šd ŠdŠ	n¶g }t          ‰
j        d         ¦  «        D ]=\  }}‰ j        |d         v r)|                     |ˆ fd„|d         D ¦   «         f¦  «         Œ>|rt          |d„ ¬¦  «        nd	\  Š}‰d uŠ	d Š‰	r*|r(ˆ
fd
„|D ¦   «         }dd                     |¦  «        › d�Šn‰	sdŠˆ
ˆfd„Š‰
j        Šˆˆ	ˆ
ˆˆfd„}|S )Nz4.29.0c                 ó.   •— ‰j         ‰ j        ‰j        dœS )N©r\   r    r÷   rA  )ræ   ru  r^   s   €€€r_   Ú	post_dataz'Endpoint.make_cancel.<locals>.post_dataê  s"   ø€ à $¤Ø$*Ô$7Ø &¤ðð ð ra   Trb   Úcancelsc                ó*   •— g | ]}|‰j         k    ¯|‘ŒS rú   )r\   )r[   rÝ  r^   s     €r_   r"  z(Endpoint.make_cancel.<locals>.<listcomp>ø  s%   ø€ ÐMÐMÐM 1¸!¸t¼}Ò:LÐ:L˜QÐ:LÐ:LÐ:Lra   c                ó,   — t          | d         ¦  «        S )Nr&   )rÿ   r·  s    r_   r¹  z&Endpoint.make_cancel.<locals>.<lambda>ü  s   € ­c°!°A´$©i¬i€ ra   )rK  )NNc                ób   •— g | ]+}d ‰j         d         |                              d¦  «        z   ‘Œ,S )rN   rb   rT  )rƒ   rY   )r[   rÜ  ræ   s     €r_   r"  z(Endpoint.make_cancel.<locals>.<listcomp>  sH   ø€ ð #ð #ð #àð ˜&œ-¨Ô7¸Ô:×>Ò>¸zÑJÔJÑJð#ð #ð #ra   z1Cancelled this job will also cancel any jobs for r¬  z that are currently running.zÒCancelling this job will not stop the server from running. To fix this, an event must be added to the upstream app that explicitly cancels this one or the upstream app must be running Gradio 4.29.0 and greater.c                 ó   •— g ‰‰ j         dœS )N)r+  r\   r    rÍ   )ræ   r\   s   €€r_   rB  z'Endpoint.make_cancel.<locals>.post_data  s   ø€ àØ (Ø$*Ô$7ðð ð ra   c                 ó¢   •— ‰ rt          j        ‰ ¦  «         ‰r5t          j        ‰f ‰¦   «         ‰j        ‰j        ‰j        dœ‰j        ¤Ž d S d S )Nr  )rA  rB  rÙ   r&  r0   rI   r2   r@   )Ú
cancel_msgÚcancellableræ   rB  rç   s   €€€€€r_   Ú_cancelz%Endpoint.make_cancel.<locals>._cancel  s~   ø€ Øð *Ý”˜jÑ)Ô)Ð)Øð Ý”
Øðà"˜™œØ"œNØ"œNØ!Ô,ðð ð Ô)ðð ð ð ð ðð ra   )ræ   r›   r   r‚  r…   r†   r‡   r‰   r   Ú
CANCEL_URLr¡   rƒ   r\   r  rã   rÄ   r‹   )r^   ru  Ú
candidatesrÜ  ÚdepÚother_cancelledÚother_api_namesrK  rI  rJ  ræ   r\   rB  rç   s   ``      @@@@@@r_   rr  zEndpoint.make_cancelÞ  s  øøøøøøøø€ ð ˆ>ØˆFØ”ˆØÔ¥¤°Ñ 9Ô 9Ò9Ð9Ý”,×&Ò& vÔ':½EÔ<LÑMÔMˆCðð ð ð ð ð ð ð ˆJØˆKˆKà68ˆJÝ# F¤M°.Ô$AÑBÔBð ð ‘��3Ø”= C¨	¤NÐ2Ð2Ø×%Ò%ØÐMÐMÐMÐM¨¨I¬ÐMÑMÔMÐNñô ð øð
 =GÐX•�JÐ$7Ð$7Ð8Ñ8Ô8Ð8ÈLñ &ˆH�oð #¨$Ð.ˆKØˆJØð ˜ð ð#ð #ð #ð #à,ð#ñ #ô #�ð
2ÈÏ	Ê	ÐRaÑHbÔHbð 2ð 2ð 2ð �
ð !ð ðRð ðð ð ð ð ð ð ”.ˆCð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð ˆra   c                ó*   ‡ ‡‡— ‰ j         Šdˆˆˆ fd„}|S )Nrï   ri  c                 ót  •— | pg ‰j         dœ|¥‰                     ¦   «         ¥} ‰j         |                     d‰	j        ¦  «        dœ}‰j        dk    r‰                     | |‰
¦  «        }nf‰j        dv rF‰	                     | |‰j        ‰
j        ¦  «        }|‰
_        ‰ 	                    ‰
|‰j        ¦  «        }nt          d‰j        › �¦  «        ‚d|v r:|d         €t          d¦  «        ‚|                     d¦  «        }t          dd	|i|¤Ž‚	 |d
         }n“# t          $ r†}‰	j        ot          j        ‰	j        ¦  «        j         }d|v r*d|d         v r |rt%          j        d‰	j        › d�¦  «        d ‚d|v rt          |d         ¦  «        d ‚t          d|› �¦  «        |‚d }~ww xY wt)          |¦  «        S )N)r+  r\   r    )r\   r    rU   )r`  ra  rb  rø   zUnsupported protocol: ÚerrorzˆThe upstream Gradio app has raised an exception but has not enabled verbose error reporting. To enable, set show_error=True in launch().rö   r+  Ú429z…Too many requests to the API, please try again later. To avoid being rate-limited, please duplicate the Space using Client.duplicate(z&) and pass in your Hugging Face token.z:Could not find 'data' key in response. Response received: rú   )r\   r*  rY   r    rQ   Ú
_sse_fn_v0r0  r,  r÷   Ú_sse_fn_v1plusru   r   rn   ÚKeyErrorrk   r=  rå  r3  r   ró  ri  )r+  rX  r  rW  r÷   rö   ÚoutputÚkeÚis_public_spaceræ   ru  r^   s            €€€r_   r;  z'Endpoint.make_predict.<locals>._predict+  sK  ø€ à˜
 Ø œMðð ð ðð
 ×*Ò*Ñ,Ô,ðˆDð !œMØ &§
¢
¨>¸6Ô;NÑ OÔ Oðð ˆIð
 Œ} Ò%Ð%ØŸš¨¨y¸&ÑAÔA��Ø”Ð"LÐLÐLØ!×+Ò+Ø˜) T¤]°FÔ4Jñô �ð #+�”Ø×,Ò,¨V°X¸t¼}ÑMÔM��å Ð!I¸$¼-Ð!IÐ!IÑJÔJÐJà˜&Ð Ð Ø˜'”?Ð*Ý"ð_ñô ð ð
 %Ÿjšj¨Ñ1Ô1�GÝ"Ð=Ð=¨7Ð=°fÐ=Ð=Ð=ðØ œ��øÝð ð ð à”Oð PÝ+Ô6°v´ÑGÔGÔOÐOð  ð ˜fÐ$Ð$¨°&¸´/Ð)AÐ)AÀoÐ)AÝÔ4ð@ØMSÌ_ð@ð @ð @ñô ð  ð	 ð
  Ð&Ð&Ý$ V¨G¤_Ñ5Ô5¸4Ð?ÝØYÐQWÐYÐYñô àðøøøøðøøøõ  ˜‘=”=Ð s   ÄD Ä
F(Ä"BF#Æ#F(©rï   ri  r1  )r^   ru  r;  ræ   s   `` @r_   r=  zEndpoint.make_predict(  s<   øøø€ Ø”ˆð5	!ð 5	!ð 5	!ð 5	!ð 5	!ð 5	!ð 5	!ð 5	!ðn ˆra   ri  c                ó¬   — t          |¦  «        }t          | j        ¦  «        D ]"\  }}|j        r|                     |d ¦  «         Œ#t          |¦  «        S rh  )r  r¡   r  r  Úinsertri  )r^   r+  rÜ  Úinput_component_types       r_   r7  zEndpoint.insert_empty_stated  sY   € Ý�D‰zŒzˆÝ'0°Ô1KÑ'LÔ'Lð 	%ð 	%Ñ#ˆAÐ#Ø#Ô,ð %Ø—’˜A˜tÑ$Ô$Ð$øÝ�T‰{Œ{Ðra   c                óà   — g }t          |¦  «        D ]N\  }}t          j        |t          | j        |¬¦  «        t          j        ¦  «        }|                     |¦  «         ŒOt          |¦  «        S )N)Ú
data_index)r¡   r   r¾  r   Ú_upload_filer¿  r  ri  )r^   r+  Údata_rÜ  rÝ  s        r_   r8  zEndpoint.process_input_filesk  sl   € ØˆÝ˜d‘O”Oð 	ð 	‰DˆAˆqÝ”ØÝ˜Ô)°aÐ8Ñ8Ô8ÝÔ+ñô ˆAð
 �LŠL˜‰OŒOˆOˆOÝ�U‰|Œ|Ðra   c                ór   — | j         j        r
 | j        |Ž }| j         j        r
 | j        |Ž } | j        |Ž }|S rh  )ræ   r1   r3   Úremove_skipped_componentsÚreduce_singleton_output)r^   r:  s     r_   rZ  zEndpoint.process_predictionsv  sR   € ð Œ;Ô%ð 	<Ø-˜$Ô-¨{Ð;ˆKØŒ;Ô'ð 	GØ8˜$Ô8¸+ÐFˆKØ2�dÔ2°KÐ@ˆØÐra   c                óô   — t          |¦  «        }| j        j        dk    r&t          j        || j        t          j        ¦  «        }n%t          j        || j        t          j        ¦  «        }t          |¦  «        S )Nrb  )	r  ræ   rQ   r   r¾  Ú_download_filer¿  Úis_file_objri  )r^   r+  rb  s      r_   r1   zEndpoint.download_files�  sd   € Ý�T‘
”
ˆØŒ;Ô :Ò-Ð-Ý”NØ�tÔ*­EÔ,Gñô ˆEˆEõ ”N 5¨$Ô*=½uÔ?PÑQÔQˆEÝ�U‰|Œ|Ðra   c                ób   — d„ t          || j        d¬¦  «        D ¦   «         }t          |¦  «        S )rT   c                ó&   — g | ]\  }}|j         °|‘ŒS rú   ©r  )r[   rÝ  Úocts      r_   r"  z6Endpoint.remove_skipped_components.<locals>.<listcomp>�  s4   € ð 
ð 
ð 
á��3Ø”8ð
Øð
ð 
ð 
ra   F)Ústrict)Úzipr  ri  rÕ  s     r_   rd  z"Endpoint.remove_skipped_components‹  s@   € ð
ð 
å˜d DÔ$?ÈÐNÑNÔNð
ñ 
ô 
ˆõ
 �T‰{Œ{Ðra   r   c                ó†   — | j         j        rd„ | j        D ¦   «         }n| j        }t          |¦  «        dk    r|d         S |S )Nc                ó    — g | ]}|j         °	|‘ŒS rú   rk  )r[   Úos     r_   r"  z4Endpoint.reduce_singleton_output.<locals>.<listcomp>–  s/   € ð +ð +ð +Ø¸a¼fð+Øð+ð +ð +ra   r&   r   )ræ   r3   r  rÿ   )r^   r+  Úeffective_output_componentss      r_   re  z Endpoint.reduce_singleton_output”  sb   € ØŒ;Ô'ð 	Fð+ð +ØÔ6ð+ñ +ô +Ð'Ð'ð +/Ô*EÐ'ÝÐ*Ñ+Ô+¨qÒ0Ð0Ø˜”7ˆNàˆKra   Úfr`  údict[str, Any]c                ó  ‡— |d         }| j         j        rB|                     dd¦  «        s,|                      |¦  «        r|                      |||¦  «        S t          |¦  «        }t          j        |¦  «        �so| j        d         |         Št          ˆfd„| j         j
        d         D ¦   «         i ¦  «        }| j         j
                             dd ¦  «        }|€t          j        n|}t          j                             |¦  «        |k    r0t!          d|› d	|› d
|                     dd¦  «        dz   › d�¦  «        ‚t#          |d¦  «        5 }d|j        |ffg}t'          j        | j         j        f| j         j        | j         j        | j         j        |dœ| j         j        ¤Ž}	d d d ¦  «         n# 1 swxY w Y   |	                     ¦   «          |	                     ¦   «         }
|
d         }|t          j        |j        ¦  «        ddidœS )Nrq   Ú	is_streamFr  c              3  ó4   •K  — | ]}|d          ‰k    ¯|V — ŒdS r   rú   )r[   Úcr  s     €r_   r!  z(Endpoint._upload_file.<locals>.<genexpr>­  s>   øè è € ð ð àØ˜”w ,Ò.Ð.ð à.Ð.Ð.Ð.ðð ra   r"  Úmax_file_sizezFile z" exceeds the maximum file size of z bytes set in r¦  rT   z component.ÚrbÚfiles)r0   rI   rÑ   r{  r   Ú_typezgradio.FileData)rq   Ú	orig_nameÚmeta)ræ   rl   rY   Ú_is_upstream_file_urlÚ_upload_upstream_filer   r   Úis_http_url_liker]   r$  rƒ   ÚmathÚinfrp   rq   Úgetsizeru   Úopenrí  rÙ   r&  r˜   r0   rI   r2   r@   r(  r   Ú!strip_invalid_filename_characters)r^   rs  r`  Ú	file_pathr}  Úcomponent_configry  Úf_r{  r‡  rW  r  s              @r_   ra  zEndpoint._upload_file   s—  ø€ Ø�f”Iˆ	àŒKÔ)ð	Hà—E’E˜+ uÑ-Ô-ð	Hð ×*Ò*¨9Ñ5Ô5ð	Hð
 ×-Ò-¨i¸¸JÑGÔGÐGå˜‘O”Oˆ	ÝÔ% iÑ0Ô0ñ 	"Øœ?¨8Ô4°ZÔ@ˆLÝ#ðð ð ð à!œ[Ô/°Ô=ðñ ô ð
 ñ ô  Ðð !œKÔ.×2Ò2°?ÀDÑIÔIˆMØ(5Ð(=�DœH˜HÀ=ˆMÝŒw�Š˜yÑ)Ô)¨MÒ9Ð9Ý ðR˜Ið Rð RÈð Rð RØ.×2Ò2°7¸BÑ?Ô?À"ÑDðRð Rð Rñô ð õ �i Ñ&Ô&ð 	¨"Ø! I¤N°BÐ#7Ð8Ð9�Ý”JØ”KÔ*ðà œKÔ/Ø œKÔ/Øœ;Ô1Øðð ð ”kÔ.ðð �ð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð ×ÒÑ Ô Ð Ø—V’V‘X”XˆFØ˜qœ	ˆIð ÝÔ@ÀÄÑPÔPØÐ/Ð0ð
ð 
ð 	
s   ÅAF0Æ0F4Æ7F4r‡  c                óš  — t          j        |¦  «        sdS 	 t          j        |¦  «        }t          j        | j        j        ¦  «        }n# t          j        $ r Y dS w xY w|j        |j        |j	        f|j        |j        |j	        fk    rdS |j
                             d¦  «        }|j
                             |› d�|› d�|› d�f¦  «        S )NFrN   z/file=z/file/z/proxy=)r   r�  rÙ   ÚURLræ   r‰   Ú
InvalidURLÚschemeræ  Úportrq   rˆ   rx   )r^   r‡  Úfile_urlÚupstream_urlÚapi_paths        r_   r  zEndpoint._is_upstream_file_urlÐ  sþ   € ÝÔ% iÑ0Ô0ð 	Ø�5ð	Ý”y Ñ+Ô+ˆHÝ œ9 T¤[Ô%=Ñ>Ô>ˆLˆLøÝÔð 	ð 	ð 	Ø�5�5ð	øøøð ŒOØŒMØŒMð
ð
 ÔØÔØÔð
ò	
ð 
ð �5àÔ$×+Ò+¨CÑ0Ô0ˆØŒ}×'Ò'ØÐ Ð Ð  XÐ"5Ð"5Ð"5¸(Ð7KÐ7KÐ7KÐLñ
ô 
ð 	
s   ˜2A ÁAÁAr�  Ú	file_datac                ó0  — |                      d¦  «        p#t          j                             |¦  «        j        }t          |¦  «        j        pd}i | j        j        ¥ddi¥}t          j
        ¦   «         5 }t          |¦  «        |z  }t          j        d|f| j        j        | j        j        | j        j        dœ|¤Ž5 }	|	                     ¦   «          t#          |d¦  «        5 }
|	                     ¦   «         D ]}|
                     |¦  «         Œ	 ddd¦  «         n# 1 swxY w Y   ddd¦  «         n# 1 swxY w Y   i |¥d	t)          |¦  «        i¥}|                     d
d¦  «         |                      ||¦  «        cddd¦  «         S # 1 swxY w Y   dS )zECopy a private upstream file into its cache before using it as input.r}  ÚfileÚfollow_redirectsFrÏ   rÐ   ÚwbNrq   rç   )rY   r…   r†   Úurlparserq   r   rí  ræ   r@   ÚtempfileÚTemporaryDirectoryrÙ   rÚ   r0   rI   r2   r(  r…  rü   Úwriter7   rn   ra  )r^   r�  r’  r`  Úoriginal_nameÚ	file_nameÚrequest_kwargsÚtemp_dirÚ	temp_pathré   Ú	temp_filer  Úupload_datas                r_   r€  zEndpoint._upload_upstream_fileé  si  € ð
 �MŠM˜+Ñ&Ô&ÐN­&¬,×*?Ò*?ÀÑ*IÔ*IÔ*Nð 	õ ˜Ñ'Ô'Ô,Ð6°ˆ	ØP˜DœKÔ4ÐPÐ6HÈ%ÐPÐPˆåÔ(Ñ*Ô*ð 	>¨hÝ˜X™œ¨Ñ2ˆIÝ”ØØðð œÔ+ØœÔ+Ø”{Ô-ðð ð !ðð ð /ð Ø×)Ò)Ñ+Ô+Ð+Ý˜) TÑ*Ô*ð /¨iØ!)×!4Ò!4Ñ!6Ô!6ð /ð /˜Ø!Ÿš¨Ñ.Ô.Ð.Ð.ð/ð/ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /ð/ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /ð @˜YÐ?¨µ°I±´Ð?Ð?ˆKØ�OŠO˜E 4Ñ(Ô(Ð(Ø×$Ò$ [°*Ñ=Ô=ð#	>ð 	>ð 	>ð 	>ñ 	>ô 	>ð 	>ð 	>ð 	>ð 	>ð 	>ð 	>øøøð 	>ð 	>ð 	>ð 	>ð 	>ð 	>s\   Á5AFÂ=%D3Ã"-DÄD3ÄD Ä D3Ä#D Ä$D3Ä'FÄ3D7	Ä7FÄ:D7	Ä;AFÆFÆFr¸  c                ó8  — |                      dd¦  «        rSd|v rO|d         }|                     d¦  «        s| j        |                     d¦  «        z   }t	          |¦  «        j        }nA| j        dz   t          j        |d         ¦  «        z   }t	          |d         ¦  «        j        pd}| j        j	        � t          j        | j        j	        d	¬
¦  «         t          j        ¦   «         }t	          t          j        ¦   «         ¦  «        t!          j        d¦  «        z  }|                     d	d	¬¦  «         t'          j        d|f| j        j        | j        j        | j        j        d	dœ| j        j        ¤Ž5 }|                     ¦   «          t5          ||z  d¦  «        5 }|                     d|j        z  ¬¦  «        D ],}|                     |¦  «         |                     |¦  «         Œ-	 d d d ¦  «         n# 1 swxY w Y   d d d ¦  «         n# 1 swxY w Y   t	          | j        j	        ¦  «        |                     ¦   «         z  }	|	                     d	d	¬¦  «         |	|z  }
tA          j!        ||z  |
¦  «         tE          |
 #                    ¦   «         ¦  «        S )Nrv  Frç   )rL   rM   rN   zfile=rq   r”  TrJ   rÎ   )rK   ÚparentsrÏ   )r0   rI   rÑ   r•  r–  é€   )Ú
chunk_size)$rY   rx   r  r„   r   rí  r   Úencode_file_pathræ   rv   rp   rs   ÚhashlibÚsha256r˜  Ú
gettempdirr6  Ú	token_hexÚmkdirrÙ   rÚ   r0   rI   r2   r@   r(  r…  rü   Ú
block_sizerj   rš  Ú	hexdigestÚshutilÚmover7   Úresolve)r^   r¸  Úurl_pathrœ  Úsharž  ré   rs  r  Ú	directoryÚdests              r_   rg  zEndpoint._download_file  sé  € à�5Š5�˜eÑ$Ô$ð 	7¨°!¨¨Ø˜”xˆHà×&Ò&Ð'>Ñ?Ô?ð @Øœ=¨8¯?ª?¸3Ñ+?Ô+?Ñ?�Ý˜X™œÔ+ˆIˆIà”} wÑ.µÔ1GÈÈ&Ì	Ñ1RÔ1RÑRˆHõ ˜Q˜vœY™œÔ,Ð6°ˆIàŒ;Ô!Ð-ÝŒK˜œÔ.¸Ð>Ñ>Ô>Ð>åŒnÑÔˆÝ�Ô+Ñ-Ô-Ñ.Ô.µÔ1BÀ2Ñ1FÔ1FÑFˆØ�Š ¨dˆÑ3Ô3Ð3åŒ\ØØð
ð ”KÔ'Ø”KÔ'Ø”;Ô)Ø!ð
ð 
ð ŒkÔ&ð
ð 
ð 	#ð Ø×%Ò%Ñ'Ô'Ð'Ý�h Ñ*¨DÑ1Ô1ð #°QØ%×0Ò0¸CÀ#Ä.Ñ<PÐ0ÑQÔQð #ð #�EØ—J’J˜uÑ%Ô%Ð%Ø—G’G˜E‘N”N�N�Nð#ð#ð #ð #ñ #ô #ð #ð #ð #ð #ð #ð #øøøð #ð #ð #ð #ð	#ð 	#ð 	#ñ 	#ô 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#øøøð 	#ð 	#ð 	#ð 	#õ ˜œÔ/Ñ0Ô0°3·=²=±?´?ÑBˆ	Ø�Š ¨tˆÑ4Ô4Ð4Ø˜9Ñ$ˆÝŒ�H˜yÑ(¨$Ñ/Ô/Ð/Ý�4—<’<‘>”>Ñ"Ô"Ð"s7   Å6(HÆAG7Ç+HÇ7G;	Ç;HÇ>G;	Ç?HÈHÈHr+  r  c                ó^  — t          j        dt          j        d ¬¦  «        | j        j        dœ| j        j        ¤Ž5 }t          j        ||||| j        j        | j        j	        | j        j
        | j        j        | j        j        | j        j        ¦
  «
        cd d d ¦  «         S # 1 swxY w Y   d S )NrÁ   )rÂ   rÑ   rú   )rÙ   r.   rû   ræ   r2   r@   r   Úget_pred_from_sse_v0rŽ   r“   r0   rI   r§   )r^   r+  r  ru  ræ   s        r_   rU  zEndpoint._sse_fn_v01  sõ   € ÝŒ\ð 
Ý”M¨$Ð/Ñ/Ô/Ø”;Ô)ð
ð 
ð ŒkÔ&ð
ð 
ð 	ð ÝÔ-ØØØØØ”Ô#Ø”Ô(Ø”Ô#Ø”Ô#Ø”Ô&Ø”Ô+ñô ð	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	s   ¼AB"Â"B&Â)B&r÷   rî   c                ó²   — t          j        || j        j        | j        j        | j        j        | j        j        ||| j        j        | j        j        ¦	  «	        S rh  )	r   Úget_pred_from_sse_v1plusræ   r0   rI   r·   rº   r2   r§   )r^   ru  r÷   rQ   s       r_   rV  zEndpoint._sse_fn_v1plusD  sR   € õ Ô-ØØŒKÔØŒKÔØŒKÔ2ØŒKÔ$ØØØŒKÔ"ØŒKÔ'ñ

ô 

ð 
	
ra   N)r`  )ræ   r.   r\   r;   r]   rm   rQ   r7   )r  r;   )rï   r&  rú  )rï   r—  )r¼  rm   rï   r=   )rï   r.   )ræ   r.   rï   rð   )ru  r   )ru  r>  r[  )rï   r   )rs  rm   r`  r;   rï   rt  )r‡  r7   rï   r=   )r�  r7   r’  rm   r`  r;   rï   rt  )r¸  rm   rï   r7   )r+  rm   r  rm   ru  r   )ru  r   r÷   r7   rQ   rî   )rû  rü  rý  rþ  r¿   r  r  r  r*  rÿ  r  Úpropertyræ   ÚsetterrÍ  rÐ  rp  rr  r=  r7  r8  rZ  r1   rd  re  ra  r  r€  rg  rU  rV  rú   ra   r_   rZ   rZ   d  s=  € € € € € ØSÐSð PXð"/ð "/ð "/ð "/ð "/ðH	
ð 	
ð 	
ð 	
ðð ð ð ð
ð ð ð ðð ð ð ð ð:ð :ð :ñ „\ð:ð ðð ð ñ „Xðð „]ð&ð &ð &ñ „]ð&ðhð hð hðð ð ðð ð ð ð0Hð Hð Hð HðT:ð :ð :ð :ðxð ð ð ð	ð 	ð 	ð 	ð	ð 	ð 	ðð ð ð ðð ð ð ð
ð 
ð 
ð 
ð.
ð .
ð .
ð .
ð`
ð 
ð 
ð 
ð2>ð >ð >ð >ð:)#ð )#ð )#ð )#ðVð ð ð ð&
ð 
ð 
ð 
ð 
ð 
ra   rZ   rW  r  Ústatusc                  ón   ‡ — e Zd ZdZ	 	 	 	 dd d„Zd!d„Zd"d„Zd#d„Zd$d%ˆ fd„Zd&d„Z	d'd„Z
d(d„Zd„ Zˆ xZS ))r^  a  
    A Job is a wrapper over the Future class that represents a prediction call that has been
    submitted by the Gradio client. This class is not meant to be instantiated directly, but rather
    is created by the Client.submit() method.

    A Job object includes methods to get the status of the prediction call, as well to get the outputs
    of the prediction call. Job objects are also iterable, and can be used in a loop to get the outputs
    of prediction calls as they become available for generator endpoints.
    NTr$  r   rd  r>  r<   r=   rk   r9   re  úCallable[[], None] | Nonec                óZ   — || _         || _        d| _        || _        || _        || _        dS )aÍ  
        Parameters:
            future: The future object that represents the prediction call, created by the Client.submit() method
            communicator: The communicator object that is used to communicate between the client and the background thread running the job
            verbose: Whether to print any status-related messages to the console
            space_id: The space ID corresponding to the Client object that created this Job object
        r   N)r$  rd  Ú_counterr<   rk   rw  )r^   r$  rd  r<   rk   re  s         r_   r¿   zJob.__init__c  s3   € ð ˆŒØ(ˆÔØˆŒØˆŒØ ˆŒØ#ˆŒˆˆra   rï   c                ó   — | S rh  rú   rÅ   s    r_   Ú__iter__zJob.__iter__y  s   € Øˆra   útuple | Anyc                ó  — | j         st          ¦   «         ‚	 | j         j        5  t          | j         j        j        ¦  «        | j        dz   k    r:| j         j        j        | j                 }| xj        dz  c_        |cd d d ¦  «         S | j         j        j        j        t          j
        k    r5| j        t          | j         j        j        ¦  «        k    rt          ¦   «         ‚t          j        d¦  «         d d d ¦  «         n# 1 swxY w Y   Œö)NTr&   gü©ñÒMbP?)rd  ÚStopIterationr9  rÿ   rx  r  r¿  Úlatest_statusÚcoder!   ÚFINISHEDr~   r   )r^   rq  s     r_   Ú__next__zJob.__next__|  sH  € ØÔ ð 	"Ý‘/”/Ð!ð	"ØÔ"Ô'ð 
"ð 
"Ý�tÔ(Ô,Ô4Ñ5Ô5¸¼ÈÑ9JÒJÐJØÔ)Ô-Ô5°d´mÔD�AØ�M”M QÑ&�M”MØð	
"ð 
"ð 
"ð 
"ñ 
"ô 
"ð 
"ð 
"ð Ô%Ô)Ô7Ô<ÅÄÒOÐOØœ­¨TÔ->Ô-BÔ-JÑ)KÔ)KÒKÐKå'™/œ/Ð)Ý”
˜5Ñ!Ô!Ð!ð
"ð 
"ð 
"ñ 
"ô 
"ð 
"ð 
"ð 
"ð 
"ð 
"ð 
"øøøð 
"ð 
"ð 
"ð 
"ð	"s   £ADÂA-DÄDÄDúAsyncGenerator[Update, None]c               óö   K  — | j         sdS 	 | j         j                             ¦   «         }	 t          j        |d¬¦  «        ƒ d{V —†}|W V — n,# t          j        $ r |                      ¦   «         rY dS Y Œjw xY wŒn)zKAsync iterator that yields all updates from the communicator.updates queue.NTg      à?rÁ   )rd  ÚupdatesrY   ÚasyncioÚwait_forÚTimeoutErrorÚdone)r^   rY   rj   s      r_   Ú	__aiter__zJob.__aiter__�  sª   è è € àÔ ð 	ØˆFð	ØÔ#Ô+×/Ò/Ñ1Ô1ˆCðÝ&Ô/°¸SÐAÑAÔAÐAÐAÐAÐAÐAÐA�Ø�����øÝÔ'ð ð ð Ø—9’9‘;”;ð Ø�F�FØ�ðøøøð	s   ¬!A Á#A7Á6A7rÂ   úfloat | Noner   c                óH   •— t          ¦   «                              |¬¦  «        S )a.  
        Return the result of the call that the future represents. Raises CancelledError: If the future was cancelled, TimeoutError: If the future didn't finish executing before the given timeout, and Exception: If the call raised then that exception will be raised.

        Parameters:
            timeout: The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time.
        Returns:
            The result of the call that the future represents. For generator functions, it will return the final iteration.
        Example:
            from gradio_client import Client
            calculator = Client(src="gradio/calculator")
            job = calculator.submit("foo", "add", 4, fn_index=0)
            job.result(timeout=5)
            >> 9
        rÁ   )ÚsuperrW  )r^   rÂ   Ú	__class__s     €r_   rW  z
Job.resultœ  s   ø€ õ ‰wŒw�~Š~ gˆ~Ñ.Ô.Ð.ra   úlist[tuple | Any]c                ó‚   — | j         sg S | j         j        5  | j         j        j        cddd¦  «         S # 1 swxY w Y   dS )aÅ  
        Returns a list containing the latest outputs from the Job.

        If the endpoint has multiple output components, the list will contain
        a tuple of results. Otherwise, it will contain the results without storing them
        in tuples.

        For endpoints that are queued, this list will contain the final job output even
        if that endpoint does not use a generator function.

        Example:
            from gradio_client import Client
            client = Client(src="gradio/count_generator")
            job = client.submit(3, api_name="/count")
            while not job.done():
                time.sleep(0.1)
            job.outputs()
            >> ['0', '1', '2']
        N)rd  r9  rx  r  rÅ   s    r_   r  zJob.outputs­  s�   € ð( Ô ð 	5ØˆIàÔ"Ô'ð 5ð 5ØÔ(Ô,Ô4ð5ð 5ð 5ð 5ñ 5ô 5ð 5ð 5ð 5ð 5ð 5ð 5øøøð 5ð 5ð 5ð 5ð 5ð 5s   –4´8»8r"   c           	     ó  — t          j        ¦   «         }d}| j        r0| j        j        5  | j        j        }ddd¦  «         n# 1 swxY w Y   |r t          t          j        ddd|dd¬¦  «        S |                      ¦   «         rL| j	        j
        s t          t          j        ddd|dd¬¦  «        S t          t          j        ddd|dd¬¦  «        S | j        s t          t          j        ddd|dd¬¦  «        S | j        j        5  | j        j        j        j        }| j        r7| j        r0|r.|dk    r(t%          dt'          |¦  «        › d| j        › d	�¦  «         | j        j        j        cddd¦  «         S # 1 swxY w Y   dS )
a<  
        Returns the latest status update from the Job in the form of a StatusUpdate
        object, which contains the following fields: code, rank, queue_size, success, time, eta, and progress_data.

        progress_data is a list of updates emitted by the gr.Progress() tracker of the event handler. Each element
        of the list has the following fields: index, length, unit, progress, desc. If the event handler does not have
        a gr.Progress() tracker, the progress_data field will be None.

        Example:
            from gradio_client import Client
            client = Client(src="gradio/calculator")
            job = client.submit(5, "add", 4, api_name="/predict")
            job.status()
            >> <Status.STARTING: 'STARTING'>
            job.status().eta
            >> 43.241  # seconds
        FNr   )rÆ  ÚrankÚ
queue_sizeÚsuccessr~   ÚetaÚprogress_dataTr(   zIDue to heavy traffic on this app, the prediction will take approximately zn seconds.For faster predictions without waiting in queue, you may duplicate the space using: Client.duplicate(r±  )r
   Únowrd  r9  Úshould_cancelr"   r!   Ú	CANCELLEDrÏ  r$  Ú
_exceptionrÇ  Ú
PROCESSINGrx  rÅ  rÛ  r<   rk   r}   r;   )r^   r~   Ú	cancelledrÛ  s       r_   r»  z
Job.statusÇ  s~  € õ$ Œ|‰~Œ~ˆØˆ	ØÔð 	<ØÔ"Ô'ð <ð <Ø Ô-Ô;�	ð<ð <ð <ñ <ô <ð <ð <ð <ð <ð <ð <øøøð <ð <ð <ð <àð 		ÝÝÔ%ØØØØØØ"ðñ ô ð ð �9Š9‰;Œ;ð '	;Ø”;Ô)ð Ý#ÝœØØ#Ø ØØØ"&ðñ ô ð õ $ÝœØØ#Ø!ØØØ"&ðñ ô ð ð Ô"ð 	;ÝÝÔ&ØØØØØØ"ðñ ô ð ð Ô"Ô'ð ;ð ;ØÔ'Ô+Ô9Ô=�Ø”<ð  D¤Mð °cð ¸cÀBºh¸hÝðQÕdgÐhkÑdlÔdlð Qð Qð AEô  ANðQð Qð Qñô ð ð Ô(Ô,Ô:ð;ð ;ð ;ð ;ñ ;ô ;ð ;ð ;ð ;ð ;ð ;ð ;øøøð ;ð ;ð ;ð ;ð ;ð ;s$   ©AÁAÁ	AÄA%E4Å4E8Å;E8c                óÜ   — | j         rM| j         j        5  d| j         _        | j        r|                      ¦   «          	 ddd¦  «         dS # 1 swxY w Y   | j                             ¦   «         S )a  Cancels the job as best as possible.

        If the app you are connecting to has the gradio queue enabled, the job
        will be cancelled locally as soon as possible. For apps that do not use the
        queue, the job cannot be cancelled if it's been sent to the local executor
        (for the time being).

        Note: In general, this DOES not stop the process from running in the upstream server
        except for the following situations:

        1. If the job is queued upstream, it will be removed from the queue and the server will not run the job
        2. If the job has iterative outputs, the job will finish as soon as the current iteration finishes running
        3. If the job has not been picked up by the queue yet, the queue will not pick up the job
        TN)rd  r9  rÞ  rw  r$  ÚcancelrÅ   s    r_   rä  z
Job.cancel  s³   € ð Ôð 	ØÔ"Ô'ð ð Ø26�Ô!Ô/Ø”>ð %Ø—N’NÑ$Ô$Ð$Øð	ð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð
 Œ{×!Ò!Ñ#Ô#Ð#s   ”)A
Á
AÁAc                ó,   — t          | j        |¦  «        S )z,Forwards any properties to the Future class.)Úgetattrr$  )r^   rí  s     r_   Ú__getattr__zJob.__getattr__(  s   € å�t”{ DÑ)Ô)Ð)ra   )NTNN)
r$  r   rd  r>  r<   r=   rk   r9   re  r½  )rï   r^  )rï   rÂ  )rï   rÉ  rh  )rÂ   rÑ  rï   r   )rï   rÕ  )rï   r"   )rï   r=   )rû  rü  rý  rþ  r¿   rÁ  rÈ  rÐ  rW  r  r»  rä  rç  Ú__classcell__)rÔ  s   @r_   r^  r^  W  sÿ   ø€ € € € € ðð ð -1ØØ#Ø04ð$ð $ð $ð $ð $ð,ð ð ð ð"ð "ð "ð "ð"ð ð ð ð/ð /ð /ð /ð /ð /ð /ð"5ð 5ð 5ð 5ð4H;ð H;ð H;ð H;ðT$ð $ð $ð $ð.*ð *ð *ð *ð *ð *ð *ra   r^  )Rrþ  Ú
__future__r   rÌ  Úconcurrent.futuresr£   r§  r   r‚  rp   rô  r6  r®  r˜  rª   r~   Úurllib.parser…   rž   rA  r²   Úcollectionsr   Úcollections.abcr   r   r   Úcontextvarsr   Údataclassesr	   r
   Ú	functoolsr   Úpathlibr   r   Útypingr   r   rÙ   r=  r   r   Úhuggingface_hub.utilsr   r   r   Ú	packagingr   rE   r   Úgradio_client.data_classesr   Úgradio_client.documentationr   Úgradio_client.exceptionsr   r   r   Úgradio_client.utilsr   r   r   r   r    r!   r"   r#   ÚenvironrY   r7   r©  rw   rÓ   rä   rà   r.   r  r	  rZ   r^  rú   ra   r_   ú<module>rú     s=  ðØ 2Ð 2à "Ð "Ð "Ð "Ð "Ð "à €€€Ø Ð Ð Ð Ø €€€Ø €€€Ø €€€Ø 	€	€	€	Ø 	€	€	€	Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø Ð Ð Ð Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø %Ð %Ð %Ð %Ð %Ð %Ø $Ð $Ð $Ð $Ð $Ð $Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ð Ð à €€€Ø Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5ðð ð ð ð ð ð ð ð ð ð
 Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ SÐ Sð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð ”:—>’>Ð"3Ñ4Ô4ð ¸¸Ø€DÐ	ˆÔ	Ñ	Ô	ÑÔ (Ñ*ñ9ô 9Ð ð Ð ØÐ Ø Ð ð 
€ˆ)�X˜z¨;Ñ7Ô7ðRð Rð Rð Rð Rñ Rô Rñ 8Ô7ðRðj  ðð ð ð ð ñ ô ñ „ðð ðð ð ð ð ñ ô ñ „ððp
ð p
ð p
ð p
ð p
ñ p
ô p
ð p
ðf 
€ˆ(�I˜xÑ(Ô(ðR*ð R*ð R*ð R*ð R*ˆ&ñ R*ô R*ñ )Ô(ðR*ð R*ð R*ra   