Spaces:
Build error
Build error
File size: 472 Bytes
6336d84 3e0e04a 6336d84 3e0e04a 6336d84 88cf9a2 6336d84 88cf9a2 3e0e04a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#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() |