Spaces:
Running
Running
roll dice app
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def
|
4 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import random
|
3 |
|
4 |
+
def roll_dice(sides=6):
|
5 |
+
return random.randint(1, sides)
|
6 |
+
|
7 |
+
demo = gr.Interface(
|
8 |
+
fn=roll_dice,
|
9 |
+
inputs=gr.Number(value=6, label="Number of Sides"),
|
10 |
+
outputs="number",
|
11 |
+
title="Dice Roller",
|
12 |
+
description="Enter the number of sides for the dice and get the roll result."
|
13 |
+
)
|
14 |
|
|
|
15 |
demo.launch()
|