Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,16 @@
|
|
1 |
-
import gradio as gr
|
2 |
import random
|
|
|
3 |
|
4 |
-
words
|
5 |
-
|
6 |
-
|
7 |
-
return random.choice(words)
|
8 |
|
9 |
-
|
10 |
-
generate_word,
|
11 |
-
inputs="
|
12 |
outputs="text",
|
13 |
title="Random Word Generator",
|
14 |
-
description="
|
15 |
)
|
16 |
|
17 |
-
|
|
|
|
|
1 |
import random
|
2 |
+
import gradio as gr
|
3 |
|
4 |
+
def generate_word(words):
|
5 |
+
words_list = words.split(",")
|
6 |
+
return random.choice(words_list)
|
|
|
7 |
|
8 |
+
iface = gr.Interface(
|
9 |
+
fn=generate_word,
|
10 |
+
inputs=gr.inputs.Textarea("Enter words separated by commas"),
|
11 |
outputs="text",
|
12 |
title="Random Word Generator",
|
13 |
+
description="Enter multiple words separated by commas to generate a random word."
|
14 |
)
|
15 |
|
16 |
+
iface.launch()
|