Update app.py
Browse files
app.py
CHANGED
@@ -31,21 +31,21 @@ We welcome contributions from the open-source community! If you're interested in
|
|
31 |
For inquiries or collaboration, feel free to reach out to us through [GitHub](https://github.com/kindahex), or [Hugging Face discussions](https://huggingface.co/spaces/kindahex/README/discussions).
|
32 |
"""
|
33 |
|
34 |
-
# Define
|
35 |
def animate_text():
|
36 |
for i in range(0, len(content), 100):
|
|
|
37 |
yield content[:i]
|
38 |
-
time.sleep(0.1)
|
39 |
|
40 |
-
#
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
text_output.update(animated)
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
demo.launch()
|
|
|
31 |
For inquiries or collaboration, feel free to reach out to us through [GitHub](https://github.com/kindahex), or [Hugging Face discussions](https://huggingface.co/spaces/kindahex/README/discussions).
|
32 |
"""
|
33 |
|
34 |
+
# Define an animation function
|
35 |
def animate_text():
|
36 |
for i in range(0, len(content), 100):
|
37 |
+
time.sleep(0.1) # Sleep for 100 milliseconds
|
38 |
yield content[:i]
|
|
|
39 |
|
40 |
+
# Create the Gradio interface
|
41 |
+
def update_text():
|
42 |
+
animated = ""
|
43 |
+
for part in animate_text():
|
44 |
+
animated = part
|
45 |
+
return animated
|
|
|
46 |
|
47 |
+
with gr.Blocks() as demo:
|
48 |
+
text_output = gr.Markdown("")
|
49 |
+
demo.markdown(content=update_text)
|
50 |
+
|
51 |
demo.launch()
|