Spaces:
Build error
Build error
| #playground | |
| import gradio as gr | |
| from fastai.vision.all import * | |
| from duckduckgo_search import ddg_images | |
| def greet(name): | |
| return "Hello " + name + "!!" | |
| def returnImages(keyword): | |
| urls= L(ddg_images(keyword, max_results=5)).itemgot("image") | |
| dest = Path() | |
| fpath = download_url(urls[0], dest, show_progress = False) | |
| im = Image.open(fpath).to_thumb(256,512) | |
| return im | |
| iface = gr.Interface(fn=greet, inputs="text", outputs="image") | |
| iface.launch() |