Skip to content

Commit

Permalink
Merge branch 'develop' into dev-jyzhan
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyongliang committed Apr 15, 2023
2 parents 63233fd + 4470feb commit 5980c80
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/ui.py
Expand Up @@ -615,6 +615,24 @@ def refresh_sd_models(request: gr.Request):

return gr.update(**(args or {}))

def refresh_sd_models(request: gr.Request):
tokens = shared.demo.server_app.tokens
cookies = request.headers['cookie'].split('; ')
access_token = None
for cookie in cookies:
if cookie.startswith('access-token'):
access_token = cookie[len('access-token=') : ]
break
username = tokens[access_token] if access_token else None

refresh_method(username)
args = refreshed_args() if callable(refreshed_args) else refreshed_args

for k, v in args.items():
setattr(refresh_component, k, v)

return gr.update(**(args or {}))

def refresh_checkpoints(sagemaker_endpoint):
refresh_method(sagemaker_endpoint)
args = refreshed_args() if callable(refreshed_args) else refreshed_args
Expand Down Expand Up @@ -1579,7 +1597,6 @@ def update_orig(image, state):
fn=modules.extras.clear_cache,
inputs=[], outputs=[]
)

with gr.Blocks(analytics_enabled=False) as modelmerger_interface:
with gr.Row().style(equal_height=False):
with gr.Column(variant='panel'):
Expand Down

0 comments on commit 5980c80

Please sign in to comment.