Skip to content

Commit

Permalink
Fix CORS issues with Lite Component Demos (#8623)
Browse files Browse the repository at this point in the history
* fix erros

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
aliabd and gradio-pr-bot committed Jun 26, 2024
1 parent b6fa6b5 commit 4c6e4e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-cases-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"website": minor
---

feat:Fix CORS issues with Lite Component Demos
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import numpy as np
import requests
from io import BytesIO
from PIL import Image
base_image = "https://gradio-builds.s3.amazonaws.com/demo-files/base.png"
building_image = requests.get("https://gradio-builds.s3.amazonaws.com/demo-files/buildings.png")
base_image = "https://gradio-docs-json.s3.us-west-2.amazonaws.com/base.png"
building_image = requests.get("https://gradio-docs-json.s3.us-west-2.amazonaws.com/buildings.png")
building_image = np.asarray(Image.open(BytesIO(building_image.content)))[:, :, -1] > 0
with gr.Blocks() as demo:
gr.AnnotatedImage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ gradio.Audio(···)
<gradio-lite shared-worker>
import gradio as gr
with gr.Blocks() as demo:
gr.Audio("https://file-examples.com/storage/fe3cb26995666504a8d6180/2017/11/file_example_MP3_700KB.mp3")
gr.Audio("https://cdn.pixabay.com/download/audio/2022/03/09/audio_7e096b862f.mp3")
demo.launch()
</gradio-lite>
</div>
Expand Down

0 comments on commit 4c6e4e0

Please sign in to comment.