File size: 642 Bytes
b43fd15 a040b91 b43fd15 a16597e b57dcb0 b43fd15 dd200eb b43fd15 a040b91 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import random
import gradio as gr
import subprocess
def randomize_words():
words = ['apple', 'banana', 'orange', 'grape', 'pear']
random.shuffle(words)
randomized_words = ' '.join(words)
return randomized_words
iface = gr.Interface(fn=randomize_words,
inputs=None,
outputs="text",
title='Random Word API',
description='Click "Generate" to get a random order of words.')
# Launch the Gradio interface
iface.launch(share=False)
# Set up Ngrok tunnel to create a public URL
ngrok_process = subprocess.Popen(['ngrok', 'http', '7860'])
|