Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
def randomize_words():
|
| 5 |
+
words = ['apple', 'banana', 'orange', 'grape', 'pear']
|
| 6 |
+
random.shuffle(words)
|
| 7 |
+
randomized_words = ' '.join(words)
|
| 8 |
+
return randomized_words
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=randomize_words,
|
| 11 |
+
title='Random Word API',
|
| 12 |
+
description='Click "Generate" to get a random order of words.',
|
| 13 |
+
server_name="localhost")
|
| 14 |
+
|
| 15 |
+
iface.launch(share=True)
|