|
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.') |
|
|
|
|
|
iface.launch(share=False) |
|
|
|
|
|
ngrok_process = subprocess.Popen(['ngrok', 'http', '7860']) |
|
|
|
|
|
ngrok_url = "Ngrok tunnel URL: https://dashboard.ngrok.com/status/tunnels" |
|
print(ngrok_url) |
|
|