mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
921716f618
* fixed visibility error in notebooks in github * Delete fixNotebooks.py deleted script used to fix notebooks * Update generate_notebooks.py fixed a small bug that prevented visibility of notebooks in GitHub
991 B
991 B
Gradio Demo: save_file_no_output¶
In [ ]:
!pip install -q gradio
In [ ]:
import random import string import gradio as gr def save_image_random_name(image): random_string = ''.join(random.choices(string.ascii_letters, k=20)) + '.png' image.save(random_string) print(f"Saved image to {random_string}!") demo = gr.Interface( fn=save_image_random_name, inputs=gr.Image(type="pil"), outputs=None, ) if __name__ == "__main__": demo.launch()