CoolFace
Apppublic

alexmac93/DiceRoll

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
app.py16 linesDownload Raw Back to root
1import gradio as gr2import random3 4def roll_dice(sides=6):5    return random.randint(1, sides)6 7demo = 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. Copy of the Dice Roll space by nsarrazin which is no longer working."13)14 15demo.launch()16