ZeroTech commited on
Commit
d350b79
1 Parent(s): cd969c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -1,17 +1,16 @@
1
- import gradio as gr
2
  import random
 
3
 
4
- words = ['Byron', 'Crow', 'Fang', 'Grom', 'Gus', 'Sam', 'Buster', 'Mandy', 'ChesterLou', 'Bo', 'Edgar', 'Gene', 'Spike', 'Belle', 'Colonel Ruffs', 'Jessie', 'El Primo', 'Piper', 'Pam', 'Mortis', 'Tara', 'Max', 'Mr. P', 'Leon', 'Sandy', 'Amber', 'Gale', 'Surge', 'Squeak', 'Meg', 'Eve', 'Bonnie', 'Otis', 'Janet', 'GrayNita', 'Dynamike', 'Barley', 'Poco', 'Rosa', 'Rico', 'Brock', 'Tick', '8-Bit', 'Emz', 'Penny', 'Frank', 'Bea', 'Sprout', 'Colette', 'Buzz', 'Griff', 'LolaStu', 'Shelly', 'Colt', 'Bull', 'Darryl', 'Carl', 'Bibi', 'Nani', 'Jacky']
5
-
6
- def generate_word():
7
- return random.choice(words)
8
 
9
- interface = gr.Interface(
10
- generate_word,
11
- inputs="button",
12
  outputs="text",
13
  title="Random Word Generator",
14
- description="Generate a random word from a pre-defined list of options"
15
  )
16
 
17
- interface.launch()
 
 
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()