Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def repeat_emoji(emoji, count):
|
4 |
+
try:
|
5 |
+
count = int(count)
|
6 |
+
if int(count) < 1:
|
7 |
+
return "Please enter a number greater than 0."
|
8 |
+
return emoji * int(count)
|
9 |
+
except:
|
10 |
+
return "Please enter a valid number."
|
11 |
+
|
12 |
+
app = gr.Interface(
|
13 |
+
fn=repeat_emoji,
|
14 |
+
inputs=[
|
15 |
+
gr.Textbox(label="Emoji", placeholder="e.g., π"),
|
16 |
+
gr.Number(label="How many times?", value=10, precision=0)
|
17 |
+
],
|
18 |
+
outputs=gr.Textbox(label="Copy Duplicated Emoji", lines=4),
|
19 |
+
title="π Emoji Duplicator",
|
20 |
+
description="Enter any emoji and choose how many times to duplicate it!",
|
21 |
+
examples=[
|
22 |
+
["π", 5],
|
23 |
+
["π", 12],
|
24 |
+
["π", 20],
|
25 |
+
["πΆ", 8],
|
26 |
+
["π", 15],
|
27 |
+
],
|
28 |
+
)
|
29 |
+
|
30 |
+
app.launch()
|