jezthejirzaman commited on
Commit
661f0c9
·
1 Parent(s): c566ad4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -605,10 +605,17 @@ t.save(myTransformer.state_dict(), "toInfer.pt")
605
  # %%
606
  import gradio as gr
607
 
 
 
 
 
608
  theme = gr.themes.Base(
609
  font=[gr.themes.GoogleFont('K2D'), 'ui-sans-serif', 'system-ui', 'sans-serif'],
610
  )
611
 
 
 
 
612
  def speak(input, tokenLength):
613
  print("-------------------------------------------")
614
  print("input: " + input)
@@ -625,7 +632,7 @@ def speak(input, tokenLength):
625
 
626
  model = gr.Interface(fn=speak,
627
  theme = theme,
628
- inputs=[gr.Textbox(label = "initial text", placeholder="To be or not to be"), gr.Slider(40, 80, step=1, value=80)],
629
  outputs="text",
630
  title = "speak shakespeare, speak!",
631
  description = "a miniature shakespeare, built from scratch by Cody Rushing via a Decoder-Only Transformer trained on shakespeare's works.\n many, but not all, words are tokenizable - if you get an error, try again with different words!")
 
605
  # %%
606
  import gradio as gr
607
 
608
+ import gradio as gr
609
+
610
+ import gradio as gr
611
+
612
  theme = gr.themes.Base(
613
  font=[gr.themes.GoogleFont('K2D'), 'ui-sans-serif', 'system-ui', 'sans-serif'],
614
  )
615
 
616
+ with gr.Blocks(theme=theme) as demo:
617
+ ...
618
+
619
  def speak(input, tokenLength):
620
  print("-------------------------------------------")
621
  print("input: " + input)
 
632
 
633
  model = gr.Interface(fn=speak,
634
  theme = theme,
635
+ inputs=[gr.Textbox(label = "initial text", placeholder="To be or not to be"), gr.Slider(1, 40, step=1, value=40)],
636
  outputs="text",
637
  title = "speak shakespeare, speak!",
638
  description = "a miniature shakespeare, built from scratch by Cody Rushing via a Decoder-Only Transformer trained on shakespeare's works.\n many, but not all, words are tokenizable - if you get an error, try again with different words!")