NeuralFalcon's picture
Create app.py
41316b3 verified
raw
history blame
779 Bytes
import gradio as gr
def repeat_emoji(emoji, count):
try:
count = int(count)
if int(count) < 1:
return "Please enter a number greater than 0."
return emoji * int(count)
except:
return "Please enter a valid number."
app = gr.Interface(
fn=repeat_emoji,
inputs=[
gr.Textbox(label="Emoji", placeholder="e.g., πŸ’€"),
gr.Number(label="How many times?", value=10, precision=0)
],
outputs=gr.Textbox(label="Copy Duplicated Emoji", lines=4),
title="πŸŒ€ Emoji Duplicator",
description="Enter any emoji and choose how many times to duplicate it!",
examples=[
["πŸ’€", 5],
["πŸ˜‚", 12],
["🌈", 20],
["🐢", 8],
["πŸ’–", 15],
],
)
app.launch()