§
     ’Þj-;  ã                   ó   — d 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 ddlmZ ddlmZ dZdZddddddœZd	\  ZZi i  e¦   «         cZZZd
„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zdd„Z d„ Z!d„ Z"dd„Z#d„ Z$dd„Z%dS )aó  Interactive exploration of a world of the Worlds gallery, server side. The gallery's full screen explorer sends JSON requests through a
hidden textbox and receives JSON responses through another one:
- {"action": "start", "path", "seconds", "steps", "memory"}: remembers the viewer's Move, Quality and Memory choices in wgp_config.json
  ("world_explorer", per world model architecture) when they changed, and queues an exploration task for the world (its model and resolution
  from the world's manifest, the task settings from the model's menus),
  or, while a generation runs, explores at once by taking the GPU from it (the generation pauses until the viewer leaves), and answers
  once the world is ready ({"action": "ready"}), which takes the model loading when it is not loaded;
- {"action": "move", "path", "keys", "text", "seconds", "steps", "memory"}: one move (held keys as "w+left", key names of the world
  model's explorer controls, such as "jump" for game worlds; optional text event,
  denoising steps, history frames seen), answered with the URL of its clip and the move's GPU statistics ({"action": "clip", "url",
  "stats"});
- {"action": "leave", "path"}: ends the exploration (and its task); the world restarts from its stored state next time;
- {"action": "render", "path", "record"}: the whole video explored so far (the world's own video, then the moves), recorded as a new
  video of the Video gallery (record true) or as a clip to replay ({"action": "rendered", "url", "recorded": its file name});
- {"action": "save", "path"}: the world as explored so far (its own segments, then the moves) saved as a new world of the Worlds gallery,
  to explore or continue later ({"action": "saved", "recorded": its file name}); the gallery shows it once the viewer leaves (refreshing
  it now would replace the viewer);
- {"action": "stats", "path"}: the whole GPU's VRAM use and load and the RAM ({"action": "stats", "stats"}), asked every second while the
  explorer shows its statistics (also before the first move, while the world is prepared).
An exploration ends with {"action": "ended"} when its task stops (aborted from the queue); a request that fails answers
{"action": "error", "message"}.
The explorer is the same for every world model; what differs comes from the world's model handler, whose query_world_explorer(base model
type, manifest, memory) every world model (model def "world_outputs") implements. For the memory profile its worlds use (memory: {"profile",
"preload": whether that profile or the VRAM Preload setting keeps blocks in VRAM}) it gives {"controls": the names of the shared explorer
controls its model understands (shared.utils.world_instructions.CONTROLS: the keys the explorer captures, its help, whether it offers text
events), "seconds": [(value, label, frames)], "steps": [(value, label)] (one choice: no Quality menu), "memory": [(value, video seconds,
needs)] (value in the frames unit of "seconds"), "memory_title", "defaults": {"seconds", "steps", "memory"}, "task": settings of the
exploration task}.é    N)ÚPath)Úgradio_file_url)ÚWORLDz.world_exploration)ÚsecondsÚstepsÚmemory©ÚconfigÚsaveÚmodel_def_ofÚ
handler_ofÚmemory_profile_of)i  i  c                 ó<   — t          d         | d         ¦  «        duS )zyWhether WanGP knows the model of a world: a world made by a model since removed or disabled can be watched, not explored.r   Ú
model_typeN)Ú_config)Úmanifests    úDC:\Users\johnn\OneDrive\Documents\AI\shared\gradio\world_explorer.pyÚworld_model_availabler   3   s   € å�>Ô" 8¨LÔ#9Ñ:Ô:À$ÐFÐFó    c                 óÒ   — | d         }t          d         |¦  «        t          d         |¦  «        d         }}i t          d         |¦  «                             || |¦  «        ¥d|i¥S )z´The controls and menus of a world's explorer, from the world's model handler (query_world_explorer) for the memory profile its
    worlds use, with that profile ("memory_profile").r   r   r   Úarchitecturer   Úmemory_profile)r   Úquery_world_explorer)r   r   r   r   s       r   Úexplorer_menusr   8   sq   € ð ˜,Ô'€JÝ"Ð#6Ô7¸
ÑCÔCÅWÈ^ÔE\Ð]gÑEhÔEhÐiwÔExˆL€FØ�g�lÔ# JÑ/Ô/×DÒDÀ\ÐS[Ð]cÑdÔdÐÐfvÐx~ÐÐÐr   c                  ó†   — t           d         pi                      d¦  «        pi } d„ |                      ¦   «         D ¦   «         S )zPwgp_config.json "world_explorer": the last choices per world model architecture.r
   Úworld_explorerc                 óD   — i | ]\  }}t          |t          ¦  «        ¯||“ŒS © )Ú
isinstanceÚdict)Ú.0ÚkeyÚvalues      r   ú
<dictcomp>z"_saved_choices.<locals>.<dictcomp>C   s-   € ÐRÐRÐR™:˜3 ½*ÀUÍDÑ:QÔ:QÐRˆC�ÐRÐRÐRr   )r   ÚgetÚitems)Úsaveds    r   Ú_saved_choicesr(   @   sA   € å�XÔÐ$ "×)Ò)Ð*:Ñ;Ô;ÐA¸r€EØRÐR¨¯ª©¬ÐRÑRÔRÐRr   c                 óÒ   ‡‡— ‰pt          | ¦  «        Št          ¦   «                              t          d         | d         ¦  «        d         i ¦  «        Šˆˆfd„t          D ¦   «         S )zÒThe Move, Quality and Memory choices the viewer opens with for a world: those of the last exploration of a world of the same model
    architecture, where they still are menu choices, else the model's defaults.r   r   r   c                 óŒ   •— i | ]@}|‰                      |¦  «        d „ ‰|         D ¦   «         v r‰|         n‰d         |         “ŒAS )c                 ó   — g | ]
}|d          ‘ŒS )r   r   )r!   Úchoices     r   ú
<listcomp>z/explorer_choices.<locals>.<dictcomp>.<listcomp>K   s   € Ð1UÐ1UÐ1UÀ°&¸´)Ð1UÐ1UÐ1Ur   Údefaults©r%   )r!   r"   Úmenusr'   s     €€r   r$   z$explorer_choices.<locals>.<dictcomp>K   sk   ø€ ð  Dð  Dð  DÐvyˆC˜uŸyšy¨™~œ~Ð1UÐ1UÈ%ÐPSÌ*Ð1UÑ1UÔ1UÐUÐU��s”�Ð[`ÐakÔ[lÐmpÔ[qð  Dð  Dð  Dr   )r   r(   r%   r   ÚMENUS)r   r0   r'   s    `@r   Úexplorer_choicesr2   F   s‰   øø€ ð Ð-•^ HÑ-Ô-€EÝÑÔ× Ò ¥¨Ô!8¸À,Ô9OÑ!PÔ!PÐQ_Ô!`ÐbdÑeÔe€Eð Dð  Dð  Dð  Dð  Dõ  ~Cð  Dñ  Dô  Dð  Dr   c                 ó”  ‡ ‡— t          |¦  «        Šˆ fd„t          D ¦   «         }ˆfd„|                     ¦   «         D ¦   «         }t          d         �rd |                     ¦   «         vr^|t          |‰¦  «        k    rLt          d         i t          ¦   «         ¥t          d         |d         ¦  «        d         |i¥¦  «         d S d S d S d S )Nc                 ó<   •— i | ]}|‰                      |¦  «        “ŒS r   r/   )r!   r"   Úrequests     €r   r$   z%_remember_choices.<locals>.<dictcomp>P   s'   ø€ Ð6Ð6Ð6¨ˆs�G—K’K Ñ$Ô$Ð6Ð6Ð6r   c                 ó^   •‡— i | ](\  }Š|t          ˆfd „‰|         D ¦   «         d¦  «        “Œ)S )c              3   ó^   •K  — | ]'}|d          t          ‰pd ¦  «        k    ¯|d          V — Œ(dS )r   N)Úfloat)r!   r,   r#   s     €r   ú	<genexpr>z/_remember_choices.<locals>.<dictcomp>.<genexpr>Q   sD   øè è € Ð_Ð_¨ÀÀqÄ	ÍUÐSXÐS]Ð\]ÑM^ÔM^Ò@^Ð@^˜& œ)Ð@^Ð@^Ð@^Ð@^Ð_Ð_r   N)Únext)r!   r"   r#   r0   s     @€r   r$   z%_remember_choices.<locals>.<dictcomp>Q   sY   øø€ ð  Jð  Jð  JÑkuÐknÐpuˆs•DÐ_Ð_Ð_Ð_°%¸´*Ð_Ñ_Ô_ÐaeÑfÔfð  Jð  Jð  Jr   r   r   r   r   )r   r1   r&   r   Úvaluesr2   r(   )r5   r   Úchoicesr0   s   `  @r   Ú_remember_choicesr=   N   s	  øø€ Ý˜8Ñ$Ô$€EØ6Ð6Ð6Ð6µÐ6Ñ6Ô6€Gð Jð  Jð  Jð  Jð  zA÷  zGò  zGñ  zIô  zIð  Jñ  Jô  J€GÝˆv„Ð" t°7·>²>Ñ3CÔ3CÐ'CÐ'CÈÕScÐdlÐnsÑStÔStÒHtÐHtÝ�ŒÐv�>Ñ+Ô+Ðv­W°^Ô-DÀXÈlÔE[Ñ-\Ô-\Ð]kÔ-lÐnuÐvÐvÑwÔwÐwÐwÐwð #Ð"Ð'CÐ'CÐHtÐHtr   c                 ó¬   — t          j        | ¦  «        5 }t          j        |                     d¦  «        ¦  «        cd d d ¦  «         S # 1 swxY w Y   d S )Nzmanifest.json)ÚzipfileÚZipFileÚjsonÚloadsÚread)ÚpathÚarchives     r   Ú	_manifestrF   V   sŒ   € Ý	Œ˜Ñ	Ô	ð 9 'ÝŒz˜'Ÿ,š, Ñ7Ô7Ñ8Ô8ð9ð 9ð 9ð 9ñ 9ô 9ð 9ð 9ð 9ð 9ð 9ð 9øøøð 9ð 9ð 9ð 9ð 9ð 9s   •'A	Á	AÁAc                 óž   — ddl m} ddlm}  || ¦  «        } ||j        ddd¬¦  «        }d|j        i|_        |                     |¦  «        S )Nr   )ÚWanGPSession©Úservice_forFT)Úwebui_stateÚconsole_outputÚconsole_isattyÚwebui_appendÚ
load_queue)Ú
shared.apirH   Úshared.deepy.hybridrJ   Ú_stateÚload_inline_queueÚ_gradio_webui_contextÚsubmit_task)ÚstateÚsettingsrH   rJ   ÚserviceÚsessions         r   Ú_submitrZ   [   su   € Ø'Ð'Ð'Ð'Ð'Ð'Ø/Ð/Ð/Ð/Ð/Ð/Øˆk˜%Ñ Ô €GØˆl w¤~ÀeÐ\aÐptÐuÑuÔu€GØ%1°7Ô3LÐ$M€GÔ!Ø×Ò˜xÑ(Ô(Ð(r   c                 óú   — d}||k     rr| j                              ¦   «         sY|duo|j        }|                      d¦  «        }|dz  }|�|d         |v r|S |rdddœS ||k     r| j                              ¦   «         ¯YdS )zqThe next event of kinds; with the exploration's queued task (job), an error event when the task ends without one.g        Ng      à?ÚtypeÚerrorzGThe exploration task ended before the world was ready (see the console))r\   Úmessage)ÚleftÚis_setÚdoneÚ
next_event)ÚexplorationÚkindsÚtimeoutÚjobÚwaitedÚfinishedÚevents          r   Ú_waitrj   d   s«   € à€FØ
�7Ò
Ð
 ;Ô#3×#:Ò#:Ñ#<Ô#<Ð
Ø˜d�?Ð/ s¤xˆØ×&Ò& sÑ+Ô+ˆØ�#‰ˆØÐ  v¤°%Ð!7Ð!7ØˆLØð 	{Ø#Ð0yÐzÐzÐzð �7Ò
Ð
 ;Ô#3×#:Ò#:Ñ#<Ô#<Ð
ð ˆ4r   c                 óŒ   — t                                | g ¦  «        D ]'}	 t          j        |¦  «         Œ# t          $ r Y Œ$w xY wd S ©N)Ú_clipsÚpopÚosÚremoveÚOSError)rD   Úclips     r   Ú_remove_clipsrs   r   s]   € Ý—
’
˜4 Ñ$Ô$ð ð ˆð	ÝŒI�d‰OŒOˆOˆOøÝð 	ð 	ð 	ØˆDð	øøøðð s   Ÿ4´
AÁ Ac                 óŠ   — 	  | |||j         ¦  «         |                     d¦  «         d S # |                     d¦  «         w xY w)NÚended)Ú
world_pathÚpublish)Úexplore_nowrV   r   rc   s       r   Ú_explore_nowry   z   sR   € ð%Øˆ�E˜: {Ô'=Ñ>Ô>Ð>à×Ò˜GÑ$Ô$Ð$Ð$Ð$øˆ×Ò˜GÑ$Ô$Ð$Ð$øøøs	   ‚+ «Ac           
      ó¶  — ddl m}m}m} t	          j        |¦  «        }|d         |d         }}|dk    r&ddlm}	 t	          j        d| |	¦   «         dœ¦  «        S |dk    �ršt          |¦  «        }
t          |
¦  «        s"t	          j        d	|d
|
d         › d�dœ¦  «        S t          ||
¦  «          ||¦  «        }|
d         |||
d         › d|
d         › �ddddœt          |
¦  «        d         ¥}t          j        | d         d<   ddlm} |�D || ¦  «        r9t#          j        t&          || |
d         |fd¬¦  «                             ¦   «          nt+          | |¦  «        t,          |<   t/          |dt0          t,                               |¦  «        ¦  «        }|�>|d         d	k    r2|                     ¦   «          t	          j        d	||d         dœ¦  «        S t	          j        |r|d         nd|dœ¦  «        S  ||¦  «        }|dk    r�|t6          v r=t6                               |¦  «         dd lm}  || ¦  «                             ¦   «          |�|                     ¦   «          t,                                |d ¦  «         tC          |¦  «         t	          j        d!|dœ¦  «        S |€t	          j        d|dœ¦  «        S |d"k    �r°| "                    tG          |                     d#¦  «        ¦  «        ¦  «         t/          |d$tH          ¦  «        }|�|d         dk    rt	          j        d|dœ¦  «        S |d#         rndd lm} dd%l%m&}  | || ¦  «        ||d&         |d'         |d(         ¦  «        }t	          j        d)|tO          tQ          |¦  «        ¦  «        |j)        d*œ¦  «        S tU          |¦  «        tV          z  }| ,                    dd¬+¦  «         tQ          ||j-        › d,|d(         d-›d.�z  ¦  «        }t]          j/        ||d&         |d'         d/d0¬1¦  «         t`           1                    |g ¦  «         2                    |¦  «         t	          j        d)|tO          |¦  «        d2œ¦  «        S |d3k    rµ| 3                    ¦   «          t/          |d4tH          ¦  «        }|�|d         dk    rt	          j        d|dœ¦  «        S dd lm} dd5l%m4}  | || ¦  «        ||d6         |d(         ¦  «        }t6           5                    |¦  «         t	          j        d7||j)        d8œ¦  «        S |                     d9¦  «        pd:}| 6                    |rd9|ind |                     d;¦  «        pd:to          |d<         ¦  «        tq          |d=         ¦  «        tq          |d>         ¦  «        ¦  «         t/          |d?tH          ¦  «        }|�|d         dk    rt	          j        d|dœ¦  «        S tU          |¦  «        tV          z  }| ,                    dd¬+¦  «         t`           1                    |g ¦  «        }tQ          ||j-        › d@ts          |¦  «        d-›d.�z  ¦  «        }t]          j/        ||d&         |d'         d/d0¬1¦  «         | 2                    |¦  «         t	          j        dA|tO          |¦  «        |                     d¦  «        dBœ¦  «        S )CNr   )ÚEXPLORE_PROMPTÚexploration_forÚopen_explorationÚactionrD   Ústats)Ú
live_stats)r~   rD   r   Ústartr]   zthe model of this world (r   z) is not available©r~   rD   r^   ÚwidthÚxÚheightg      ð?ÚFG)r   ÚpromptÚcustom_guideÚ
resolutionÚguidance_scaleÚseedÚmulti_prompts_gen_typeÚtaskÚgenÚlast_gallery_source)Úmain_generation_runningT)ÚtargetÚargsÚdaemon)Úreadyru   r\   r^   ru   )r~   rD   ÚleaverI   r_   ÚrenderÚrecord)Úrenderedru   )Úadd_exploration_videoÚframesÚfpsÚmovesr˜   )r~   rD   ÚurlÚrecorded)ÚparentsÚexist_okÚ_replay_Ú04dz.mp4Úlibx264é   )r›   ÚcodecÚquality)r~   rD   r�   r   )r'   ru   )Úadd_exploration_worldÚdatar'   )r~   rD   rž   ÚkeysÚ Útextr   r   r   )rr   ru   Ú_rr   )r~   rD   r�   r   ):Úshared.utils.world_explorationr{   r|   r}   rA   rB   Úshared.utils.statsr€   ÚdumpsrF   r   r=   r   r   ÚidÚshared.utils.process_locksr�   Ú	threadingÚThreadry   r�   rZ   Ú_jobsrj   Ú_START_TIMEOUTr%   r•   Ú_savedÚdiscardrQ   rJ   Úhost_changedrn   rs   r–   ÚboolÚ_MOVE_TIMEOUTÚshared.gradio.gallery_snapshotsr™   r   ÚstrÚnamer   ÚCLIP_FOLDERÚmkdirÚtokenÚiioÚimwriterm   Ú
setdefaultÚappendr   r§   ÚaddÚmover8   ÚintÚlen)rV   r5   Úoutputs_folderrx   r{   r|   r}   r~   rD   r€   r   rc   rW   r�   ri   rJ   r™   ÚoutputÚfolderrr   r§   r©   Úclipss                          r   Úhandle_requestrÍ   �   sø  € Ø`Ð`Ð`Ð`Ð`Ð`Ð`Ð`Ð`Ð`ÝŒj˜Ñ!Ô!€GØ˜8Ô$ g¨f¤oˆD€FØ�ÒÐØ1Ð1Ð1Ð1Ð1Ð1ÝŒz W°dÀZÀZÁ\Ä\ÐRÐRÑSÔSÐSØ�ÒÑÝ˜T‘?”?ˆÝ$ XÑ.Ô.ð 	TÝ”:¨¸$ð  LRÐgoÐp|Ôg}ð  LRð  LRð  LRð  Sð  Sñ  Tô  Tð  TÝ˜' 8Ñ,Ô,Ð,Ø&Ð& tÑ,Ô,ˆØ"*¨<Ô"8ÀNÐdhð  |Dð  ELô  |Mð  ydð  ydð  PXð  Yaô  Pbð  ydð  ydØ&)°1ÐPTðzð zÝXfÐgoÑXpÔXpÐqwÔXxðzˆå.3¬hˆˆeŒÐ*Ñ+ØFÐFÐFÐFÐFÐFØÐ"Ð'>Ð'>¸uÑ'EÔ'EÐ"ÝÔ¥L¸ÀUÈHÐUaÔLbÐdoÐ7pÐy}Ð~Ñ~Ô~÷  Eò  Eñ  Gô  Gð  Gð  Gå! %¨Ñ2Ô2�E�$‰KÝ�kÐ#5µ~ÅuÇyÂyÐQUÁÄÑWÔWˆØÐ  v¤°'Ò!9Ð!9Ø×ÒÑÔÐÝ”:¨¸$È5ÐQZÔK[Ð\Ð\Ñ]Ô]Ð]ÝŒz°eÐ%H U¨6¤] ]ÀÐRVÐWÐWÑXÔXÐXØ!�/ $Ñ'Ô'€KØ�ÒÐØ•6ˆ>ˆ>Ý�NŠN˜4Ñ Ô Ð Ø7Ð7Ð7Ð7Ð7Ð7ØˆK˜ÑÔ×+Ò+Ñ-Ô-Ð-ØÐ"Ø×ÒÑÔÐÝ�	Š	�$˜ÑÔÐÝ�dÑÔÐÝŒz V°TÐ:Ð:Ñ;Ô;Ð;ØÐÝŒz W°dÐ;Ð;Ñ<Ô<Ð<Ø�ÒÑØ×Ò�4 §¢¨HÑ 5Ô 5Ñ6Ô6Ñ7Ô7Ð7Ý�kÐ#8½-ÑHÔHˆØˆ=˜E &œM¨WÒ4Ð4Ý”:¨¸$Ð?Ð?Ñ@Ô@Ð@Ø�Œ?ð 	BØ7Ð7Ð7Ð7Ð7Ð7ØMÐMÐMÐMÐMÐMØ*Ð*¨;¨;°uÑ+=Ô+=¸tÀUÈ8Ä_ÐV[Ð\aÔVbÐdiÐjqÔdrÑsÔsˆFÝ”:¨¸TÍ/ÕZ]Ð^dÑZeÔZeÑJfÔJfÐtzÔtð  Að  Añ  Bô  Bð  BÝ�nÑ%Ô%­Ñ3ˆØ�Š˜T¨DˆÑ1Ô1Ð1Ý�6˜{Ô0ÐRÐR¸%À¼.ÐRÐRÐRÐRÑRÑSÔSˆÝŒ�D˜% œ/¨u°U¬|À9ÐVWÐXÑXÔXÐXÝ×Ò˜$ Ñ#Ô#×*Ò*¨4Ñ0Ô0Ð0ÝŒz Z¸ÅoÐVZÑF[ÔF[Ð\Ð\Ñ]Ô]Ð]Ø�ÒÐØ×ÒÑÔÐÝ�kÐ#5µ}ÑEÔEˆØˆ=˜E &œM¨WÒ4Ð4Ý”:¨¸$Ð?Ð?Ñ@Ô@Ð@Ø3Ð3Ð3Ð3Ð3Ð3ØIÐIÐIÐIÐIÐIØ&Ð& { {°5Ñ'9Ô'9¸4ÀÀvÄÐPUÐV]ÔP^Ñ_Ô_ˆÝ�
Š
�4ÑÔÐÝŒz W°dÈÌÐTÐTÑUÔUÐUØ�;Š;�vÑÔÐ$ "€DØ×Ò tÐ5�f˜d�^�^°°w·{²{À6Ñ7JÔ7JÐ7PÈbÕRWÐX_Ð`iÔXjÑRkÔRkÕmpÐqxð  zAô  rBñ  nCô  nCõ  EHð  IPð  QYô  IZñ  E[ô  E[ñ  \ô  \ð  \Ý�+Ð0µ-Ñ@Ô@€EØ€}˜˜fœ¨Ò0Ð0ÝŒz W°dÐ;Ð;Ñ<Ô<Ð<Ý�.Ñ!Ô!¥KÑ/€FØ
‡L‚L˜¨€LÑ-Ô-Ð-Ý×Ò˜d BÑ'Ô'€EÝˆv˜;Ô,ÐCÐC­s°5©z¬zÐCÐCÐCÐCÑCÑDÔD€DÝ„K��e˜H”o¨5°¬<¸yÐRSÐTÑTÔTÐTØ	‡L‚L�ÑÔÐÝŒ: °½oÈdÑ>SÔ>SÐ^c×^gÒ^gÐhoÑ^pÔ^pÐqÐqÑrÔrÐrr   c                 ó\   — t          j        t          | ¦  «        t          z  d¬¦  «         dS )z9Removes the clips left by explorations of a previous run.T)Úignore_errorsN)ÚshutilÚrmtreer   r¾   )rÉ   s    r   Úclear_clip_folderrÒ   Ð   s*   € å
„M•$�~Ñ&Ô&­Ñ4ÀDÐIÑIÔIÐIÐIÐIr   c           
      ó(  ‡‡— t                                |||||¬¦  «         ddl}|                     dd¬¦  «        }	|                     dd¬¦  «        }
ˆˆfd„}|	                     || |	g|
gd	dd
dd¬¦  «                             d|
gdd¬¦  «         dS )aP  The request / response textboxes of the Worlds gallery explorer (outputs_folder_of(state): the folder of its clips; model_def_of(model_type):
    a model's definition; handler_of(model_type): its handler, whose query_world_explorer gives the controls and menus of its worlds;
    explore_now(state, model_type, world_path): serves an exploration
    outside the queue, taking the GPU from a running generation; config: wgp_config.json, save_choices(choices): saves the viewer's choices
    in it; memory_profile_of(model_type): the memory profile of a model's worlds, {"profile", "preload"}).r	   r   NFÚwangp_world_request)ÚvisibleÚelem_idÚwangp_world_responsec                 ó"  •— 	 t          | | ‰| ¦  «        ‰¦  «        S # t          $ rf}t          j        ¦   «          t	          j        dt	          j        |¦  «        d         t          |¦  «        p|j        j	        dœ¦  «        cY d }~S d }~ww xY w)Nr]   rD   r‚   )
rÍ   Ú	ExceptionÚ	tracebackÚ	print_excrA   r¯   rB   r¼   Ú	__class__Ú__name__)Ústate_valuer#   Úexcrx   Úoutputs_folder_ofs      €€r   Úanswerzbind.<locals>.answerà   sÐ   ø€ ð	EÝ! +¨uÐ6GÐ6GÈÑ6TÔ6TÐVaÑbÔbÐbøÝð 	Eð 	Eð 	EÝÔÑ!Ô!Ð!Ý”:¨½$¼*ÀUÑ:KÔ:KÈFÔ:SÕ`cÐdgÑ`hÔ`hð  aCÐloÔlyô  mCð  Dð  Dñ  Eô  Eð  Eð  Eð  Eð  Eð  Eð  Eøøøøð	Eøøøs   ƒ ž
B¨AB	ÂBÂ	BTÚmultipleÚhidden)ÚinputsÚoutputsÚqueueÚconcurrency_limitÚtrigger_modeÚshow_progressÚapi_namezJ(value) => { if (window.WangpWorld) window.WangpWorld.onResponse(value); })Úfnrä   rå   Újs)r   ÚupdateÚgradioÚTextboxÚinputÚthen)rV   rà   r   r   rx   r
   Úsave_choicesr   Úgrr5   Úresponserá   s    `  `       r   Úbindrõ   Õ   s   øø€ õ ‡N‚N˜& |À,Ð[eð  zK€Nñ  Lô  Lð  LØÐÐÐØ�jŠj Ð0EˆjÑFÔF€GØ�zŠz %Ð1GˆzÑHÔH€HðEð Eð Eð Eð Eð Eð ‡M‚M�& %¨Ð!1¸H¸:Ø°À:Ð]eÐpuð ñ wô wßw{Òw{Ø˜˜
¨Dð  6Bð x|ñ xCô xCð xCð xCð xCr   rl   )NNNN)&Ú__doc__rA   ro   rÐ   r²   rÚ   r?   Úpathlibr   Ú
imageio.v3Úv3rÁ   Úshared.gradio.strip_galleryr   Úshared.utils.gallery_sourcesr   r¾   r1   r   rµ   rº   Úsetr´   rm   r¶   r   r   r(   r2   r=   rF   rZ   rj   rs   ry   rÍ   rÒ   rõ   r   r   r   ú<module>rý      sÖ  ððð ð8 €€€Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð à 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø .Ð .Ð .Ð .Ð .Ð .à"€Ø&€Ø 4¸ÈTÐhlÐ
mÐ
m€à *Ñ €�Ø˜B  ¡¤Ð €€vˆvðGð Gð Gð
@ð @ð @ðSð Sð SðDð Dð Dð Dðxð xð xð9ð 9ð 9ð
)ð )ð )ðð ð ð ðð ð ð%ð %ð %ðLsð Lsð Lsð Lsð^Jð Jð Jð
Cð Cð Cð Cð Cð Cr   