Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
+
|
| 4 |
+
def generate_word(green, yellow, blue):
|
| 5 |
+
colors = [green, yellow, blue]
|
| 6 |
+
random.shuffle(colors)
|
| 7 |
+
return "".join(colors)
|
| 8 |
+
|
| 9 |
+
interface = gr.Interface(
|
| 10 |
+
generate_word,
|
| 11 |
+
inputs=["text", "text", "text"],
|
| 12 |
+
outputs="text",
|
| 13 |
+
inputs_label=["Green", "Yellow", "Blue"],
|
| 14 |
+
inputs_default=["green", "yellow", "blue"],
|
| 15 |
+
inputs_type=["text", "text", "text"],
|
| 16 |
+
inputs_layout=["vertical"]*3,
|
| 17 |
+
examples=[
|
| 18 |
+
["lime", "gold", "navy"],
|
| 19 |
+
["olive", "lemon", "teal"]
|
| 20 |
+
],
|
| 21 |
+
description="Generate a random word with specified colors"
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
interface.launch()
|