Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import random
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
def randomize_words():
|
| 5 |
words = ['apple', 'banana', 'orange', 'grape', 'pear']
|
|
@@ -13,4 +14,9 @@ iface = gr.Interface(fn=randomize_words,
|
|
| 13 |
title='Random Word API',
|
| 14 |
description='Click "Generate" to get a random order of words.')
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import random
|
| 2 |
import gradio as gr
|
| 3 |
+
import subprocess
|
| 4 |
|
| 5 |
def randomize_words():
|
| 6 |
words = ['apple', 'banana', 'orange', 'grape', 'pear']
|
|
|
|
| 14 |
title='Random Word API',
|
| 15 |
description='Click "Generate" to get a random order of words.')
|
| 16 |
|
| 17 |
+
# Launch the Gradio interface
|
| 18 |
+
iface.launch(share=False)
|
| 19 |
+
|
| 20 |
+
# Set up Ngrok tunnel to create a public URL
|
| 21 |
+
ngrok_process = subprocess.Popen(['ngrok', 'http', '7860'])
|
| 22 |
+
|