mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-03 01:50:59 +08:00
f3b3736596
* guide on 4 kinds of interfaces * interfaces * changelog * added demo * added demos and edited markdown Added standard and unified interface demos, along with updates to the markdown. * updated notebooks Updated notebooks with markdown changes and bug fixes * interfaces * moved location of guide * ranemd * renamed * removed demo * updated blocks code to interfaces * upload requirements.txt file * Delete run.ipynb to add another notebook file upload and replace * Add run.ipynb via upload option Notebook for unified interface demo * fixed typo * fixes * update demos * notebooks --------- Co-authored-by: yuvraj sharma <48665385+yvrjsharma@users.noreply.github.com>
16 lines
394 B
Python
16 lines
394 B
Python
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() |