File size: 779 Bytes
b43fd15
 
a040b91
b43fd15
 
 
 
 
 
 
 
a16597e
b57dcb0
b43fd15
dd200eb
b43fd15
a040b91
 
 
 
 
 
9feeb34
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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'])

# Display the Ngrok tunnel URL in the output
ngrok_url = "Ngrok tunnel URL: https://dashboard.ngrok.com/status/tunnels"
print(ngrok_url)