Skip to content

Commit

Permalink
Fix the expired image link used in theme builder (#4944)
Browse files Browse the repository at this point in the history
* fix the expired image link

* update CHANGELOG.md

* Update gradio/themes/app.py

change the image link same as the original one

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Update gradio/themes/app.py

change the image link same as the original one

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* apply lint

* equalize the default image link with app.py

* equalize default image links in building theme

* equalize default image links in demo notebook

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
  • Loading branch information
deepkyu and abidlabs committed Jul 17, 2023
1 parent 6d40cdc commit e6cf145
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@
* The `.change()` event is fixed in `Audio` so that fires when the component value is programmatically updated by [@abidlabs](https://github.com/abidlabs) in [PR 4793](https://github.com/gradio-app/gradio/pull/4793)
- Fixed bug where `gr.Video` could not preprocess urls by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4904](https://github.com/gradio-app/gradio/pull/4904)
- Fixed copy button rendering in API page on Safari by [@aliabid94](https://github.com/aliabid94) in [PR 4924](https://github.com/gradio-app/gradio/pull/4924)
- Fixed broken image link in auto-generated `app.py` from `ThemeClass.push_to_hub` by [@deepkyu](https://github.com/deepkyu) in [PR 4944](https://github.com/gradio-app/gradio/pull/4944)

## Other Changes:

Expand Down
2 changes: 1 addition & 1 deletion demo/blocks_kitchen_sink/run.ipynb

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions demo/blocks_kitchen_sink/run.py
Expand Up @@ -112,7 +112,8 @@
check = gr.Checkbox(label="Go")
with gr.Column(variant="panel", scale=2):
img = gr.Image(
"https://gradio.app/assets/img/header-image.jpg", label="Image"
"https://raw.githubusercontent.com/gradio-app/gradio/main/js/_website/src/assets/img/header-image.jpg",
label="Image"
).style(height=320)
with gr.Row():
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
Expand All @@ -122,7 +123,7 @@

def go(*args):
time.sleep(3)
return "https://i.ibb.co/6BgKdSj/groot.jpg"
return "https://raw.githubusercontent.com/gradio-app/gradio/main/js/_website/src/assets/img/header-image.jpg"

go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")

Expand Down
5 changes: 3 additions & 2 deletions gradio/themes/app.py
Expand Up @@ -63,7 +63,8 @@
check = gr.Checkbox(label="Go")
with gr.Column(variant="panel", scale=2):
img = gr.Image(
"https://gradio.app/assets/img/header-image.jpg", label="Image"
"https://raw.githubusercontent.com/gradio-app/gradio/main/js/_website/src/assets/img/header-image.jpg",
label="Image",
).style(height=320)
with gr.Row():
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
Expand All @@ -73,7 +74,7 @@

def go(*args):
time.sleep(3)
return "https://gradio.app/assets/img/header-image.jpg"
return "https://raw.githubusercontent.com/gradio-app/gradio/main/js/_website/src/assets/img/header-image.jpg"

go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")

Expand Down
6 changes: 4 additions & 2 deletions gradio/themes/builder_app.py
Expand Up @@ -351,7 +351,9 @@ def get_doc_theme_var_groups():
check = gr.Checkbox(label="Go")
with gr.Column(variant="panel", scale=2):
img = gr.Image(
"https://i.ibb.co/6BgKdSj/groot.jpg", label="Image", height=320
"https://raw.githubusercontent.com/gradio-app/gradio/main/js/_website/src/assets/img/header-image.jpg",
label="Image",
height=320,
)
with gr.Row():
go_btn = gr.Button(
Expand All @@ -363,7 +365,7 @@ def get_doc_theme_var_groups():

def go(*args):
time.sleep(3)
return "https://i.ibb.co/6BgKdSj/groot.jpg"
return "https://raw.githubusercontent.com/gradio-app/gradio/main/js/_website/src/assets/img/header-image.jpg"

go_btn.click(
go,
Expand Down

1 comment on commit e6cf145

@vercel
Copy link

@vercel vercel bot commented on e6cf145 Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.