Hev832 commited on
Commit
6885980
·
verified ·
1 Parent(s): bf447db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
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 the animation function
35
  def animate_text():
36
  for i in range(0, len(content), 100):
 
37
  yield content[:i]
38
- time.sleep(0.1)
39
 
40
- # Build the Gradio interface
41
- with gr.Blocks() as demo:
42
- text_output = gr.Markdown()
43
-
44
- def update_text():
45
- for animated in animate_text():
46
- text_output.update(animated)
47
 
48
- demo.load(None, None, text_output, _js="() => setTimeout(() => {window.requestAnimationFrame(run)}, 1000)")
49
-
50
- # Launch the Gradio app
 
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()