File size: 337 Bytes
9a41787
c3df30c
9a41787
c3df30c
 
 
 
 
 
6eb4c07
c3df30c
 
 
9a41787
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
import random

def roll_dice(sides=6):
    return random.randint(1, sides)

demo = gr.Interface(
    fn=roll_dice, 
    inputs=gr.Number(value=6, label="Number of Sides"), 
    outputs="text", 
    title="Dice Roller",
    description="Enter the number of sides for the dice and get the roll result."
)

demo.launch()