laurentlb commited on
Commit
9dcf2b9
·
1 Parent(s): 827157e
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="text",
11
+ title="Dice Roller",
12
+ description="Enter the number of sides for the dice and get the roll result."
13
+ )
14
+
15
+ demo.launch()
16
+