gfhayworth commited on
Commit
67f3082
1 Parent(s): cdb77c2

Update app.py

Browse files

remove unused settings tabs from gradio

Files changed (1) hide show
  1. app.py +90 -104
app.py CHANGED
@@ -629,11 +629,8 @@ with gr.Blocks(css=CSS) as block:
629
  with gr.Row():
630
  with gr.Column():
631
  gr.HTML(
632
- """<b><center>Personalized + Multi-lingual + Empathetic + Agent: Human Care Humana.</center></b>
633
- <p><center>In <b>Translate to</b>: Choose <b>Language level</b> (e.g. for conversation practice or explain like I'm five)</center></p>""")
634
 
635
- # openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...)",
636
- # show_label=False, lines=1, type='password')
637
  with gr.Row():
638
  with gr.Column(scale=1, min_width=TALKING_HEAD_WIDTH, visible=True):
639
  speak_text_cb = gr.Checkbox(label="Enable speech", value=True)
@@ -747,94 +744,94 @@ with gr.Blocks(css=CSS) as block:
747
  translate_to_state],
748
  outputs=[translate_to_state])
749
 
750
- with gr.Tab("Formality"):
751
- formality_radio = gr.Radio(label="Formality:",
752
- choices=[FORMALITY_DEFAULT,
753
- "Casual", "Polite", "Honorific"],
754
- value=FORMALITY_DEFAULT)
755
- formality_radio.change(update_foo,
756
- inputs=[formality_radio, formality_state],
757
- outputs=[formality_state])
758
-
759
- with gr.Tab("Lit style"):
760
- literary_style_radio = gr.Radio(label="Literary style:", choices=[
761
- LITERARY_STYLE_DEFAULT, "Prose", "Summary", "Outline", "Bullets", "Poetry", "Haiku", "Limerick", "Joke",
762
- "Knock-knock"],
763
- value=LITERARY_STYLE_DEFAULT)
764
-
765
- literary_style_radio.change(update_foo,
766
- inputs=[literary_style_radio,
767
- literary_style_state],
768
- outputs=[literary_style_state])
769
-
770
- with gr.Tab("Emotions"):
771
- anticipation_level_radio = gr.Radio(label="Anticipation level:",
772
- choices=[
773
- EMOTION_DEFAULT, "Interest", "Anticipation", "Vigilance"],
774
- value=EMOTION_DEFAULT)
775
- anticipation_level_radio.change(update_foo,
776
- inputs=[anticipation_level_radio,
777
- anticipation_level_state],
778
- outputs=[anticipation_level_state])
779
-
780
- joy_level_radio = gr.Radio(label="Joy level:",
781
- choices=[EMOTION_DEFAULT,
782
- "Serenity", "Joy", "Ecstasy"],
783
- value=EMOTION_DEFAULT)
784
- joy_level_radio.change(update_foo,
785
- inputs=[joy_level_radio, joy_level_state],
786
- outputs=[joy_level_state])
787
-
788
- trust_level_radio = gr.Radio(label="Trust level:",
789
- choices=[
790
- EMOTION_DEFAULT, "Acceptance", "Trust", "Admiration"],
791
- value=EMOTION_DEFAULT)
792
- trust_level_radio.change(update_foo,
793
- inputs=[trust_level_radio, trust_level_state],
794
- outputs=[trust_level_state])
795
-
796
- fear_level_radio = gr.Radio(label="Fear level:",
797
- choices=[EMOTION_DEFAULT,
798
- "Apprehension", "Fear", "Terror"],
799
- value=EMOTION_DEFAULT)
800
- fear_level_radio.change(update_foo,
801
- inputs=[fear_level_radio, fear_level_state],
802
- outputs=[fear_level_state])
803
-
804
- surprise_level_radio = gr.Radio(label="Surprise level:",
805
- choices=[
806
- EMOTION_DEFAULT, "Distraction", "Surprise", "Amazement"],
807
- value=EMOTION_DEFAULT)
808
- surprise_level_radio.change(update_foo,
809
- inputs=[surprise_level_radio,
810
- surprise_level_state],
811
- outputs=[surprise_level_state])
812
-
813
- sadness_level_radio = gr.Radio(label="Sadness level:",
814
- choices=[
815
- EMOTION_DEFAULT, "Pensiveness", "Sadness", "Grief"],
816
- value=EMOTION_DEFAULT)
817
- sadness_level_radio.change(update_foo,
818
- inputs=[sadness_level_radio,
819
- sadness_level_state],
820
- outputs=[sadness_level_state])
821
-
822
- disgust_level_radio = gr.Radio(label="Disgust level:",
823
- choices=[EMOTION_DEFAULT,
824
- "Boredom", "Disgust", "Loathing"],
825
- value=EMOTION_DEFAULT)
826
- disgust_level_radio.change(update_foo,
827
- inputs=[disgust_level_radio,
828
- disgust_level_state],
829
- outputs=[disgust_level_state])
830
-
831
- anger_level_radio = gr.Radio(label="Anger level:",
832
- choices=[EMOTION_DEFAULT,
833
- "Annoyance", "Anger", "Rage"],
834
- value=EMOTION_DEFAULT)
835
- anger_level_radio.change(update_foo,
836
- inputs=[anger_level_radio, anger_level_state],
837
- outputs=[anger_level_state])
838
 
839
  with gr.Tab("Max words"):
840
  num_words_slider = gr.Slider(label="Max number of words to generate (0 for don't care)",
@@ -845,19 +842,8 @@ with gr.Blocks(css=CSS) as block:
845
 
846
  gr.HTML(AUTHORS)
847
 
848
- # gr.HTML("""
849
- # <form action="https://www.paypal.com/donate" method="post" target="_blank">
850
- # <input type="hidden" name="business" value="AK8BVNALBXSPQ" />
851
- # <input type="hidden" name="no_recurring" value="0" />
852
- # <input type="hidden" name="item_name" value="Please consider helping to defray the cost of APIs such as SerpAPI and WolframAlpha that this app uses." />
853
- # <input type="hidden" name="currency_code" value="USD" />
854
- # <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
855
- # <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
856
- # </form>
857
- # """)
858
-
859
  gr.HTML("""<center>
860
- <a href="https://huggingface.co/spaces/gfhayworth/hack_qa?duplicate=true">
861
  <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
862
  Powered by <a href='https://github.com/hwchase17/langchain'>LangChain 🦜️🔗</a>
863
  </center>""")
 
629
  with gr.Row():
630
  with gr.Column():
631
  gr.HTML(
632
+ """<b><center>NLP QA Chat Demo</center></b>""")
 
633
 
 
 
634
  with gr.Row():
635
  with gr.Column(scale=1, min_width=TALKING_HEAD_WIDTH, visible=True):
636
  speak_text_cb = gr.Checkbox(label="Enable speech", value=True)
 
744
  translate_to_state],
745
  outputs=[translate_to_state])
746
 
747
+ # with gr.Tab("Formality"):
748
+ # formality_radio = gr.Radio(label="Formality:",
749
+ # choices=[FORMALITY_DEFAULT,
750
+ # "Casual", "Polite", "Honorific"],
751
+ # value=FORMALITY_DEFAULT)
752
+ # formality_radio.change(update_foo,
753
+ # inputs=[formality_radio, formality_state],
754
+ # outputs=[formality_state])
755
+
756
+ # with gr.Tab("Lit style"):
757
+ # literary_style_radio = gr.Radio(label="Literary style:", choices=[
758
+ # LITERARY_STYLE_DEFAULT, "Prose", "Summary", "Outline", "Bullets", "Poetry", "Haiku", "Limerick", "Joke",
759
+ # "Knock-knock"],
760
+ # value=LITERARY_STYLE_DEFAULT)
761
+
762
+ # literary_style_radio.change(update_foo,
763
+ # inputs=[literary_style_radio,
764
+ # literary_style_state],
765
+ # outputs=[literary_style_state])
766
+
767
+ # with gr.Tab("Emotions"):
768
+ # anticipation_level_radio = gr.Radio(label="Anticipation level:",
769
+ # choices=[
770
+ # EMOTION_DEFAULT, "Interest", "Anticipation", "Vigilance"],
771
+ # value=EMOTION_DEFAULT)
772
+ # anticipation_level_radio.change(update_foo,
773
+ # inputs=[anticipation_level_radio,
774
+ # anticipation_level_state],
775
+ # outputs=[anticipation_level_state])
776
+
777
+ # joy_level_radio = gr.Radio(label="Joy level:",
778
+ # choices=[EMOTION_DEFAULT,
779
+ # "Serenity", "Joy", "Ecstasy"],
780
+ # value=EMOTION_DEFAULT)
781
+ # joy_level_radio.change(update_foo,
782
+ # inputs=[joy_level_radio, joy_level_state],
783
+ # outputs=[joy_level_state])
784
+
785
+ # trust_level_radio = gr.Radio(label="Trust level:",
786
+ # choices=[
787
+ # EMOTION_DEFAULT, "Acceptance", "Trust", "Admiration"],
788
+ # value=EMOTION_DEFAULT)
789
+ # trust_level_radio.change(update_foo,
790
+ # inputs=[trust_level_radio, trust_level_state],
791
+ # outputs=[trust_level_state])
792
+
793
+ # fear_level_radio = gr.Radio(label="Fear level:",
794
+ # choices=[EMOTION_DEFAULT,
795
+ # "Apprehension", "Fear", "Terror"],
796
+ # value=EMOTION_DEFAULT)
797
+ # fear_level_radio.change(update_foo,
798
+ # inputs=[fear_level_radio, fear_level_state],
799
+ # outputs=[fear_level_state])
800
+
801
+ # surprise_level_radio = gr.Radio(label="Surprise level:",
802
+ # choices=[
803
+ # EMOTION_DEFAULT, "Distraction", "Surprise", "Amazement"],
804
+ # value=EMOTION_DEFAULT)
805
+ # surprise_level_radio.change(update_foo,
806
+ # inputs=[surprise_level_radio,
807
+ # surprise_level_state],
808
+ # outputs=[surprise_level_state])
809
+
810
+ # sadness_level_radio = gr.Radio(label="Sadness level:",
811
+ # choices=[
812
+ # EMOTION_DEFAULT, "Pensiveness", "Sadness", "Grief"],
813
+ # value=EMOTION_DEFAULT)
814
+ # sadness_level_radio.change(update_foo,
815
+ # inputs=[sadness_level_radio,
816
+ # sadness_level_state],
817
+ # outputs=[sadness_level_state])
818
+
819
+ # disgust_level_radio = gr.Radio(label="Disgust level:",
820
+ # choices=[EMOTION_DEFAULT,
821
+ # "Boredom", "Disgust", "Loathing"],
822
+ # value=EMOTION_DEFAULT)
823
+ # disgust_level_radio.change(update_foo,
824
+ # inputs=[disgust_level_radio,
825
+ # disgust_level_state],
826
+ # outputs=[disgust_level_state])
827
+
828
+ # anger_level_radio = gr.Radio(label="Anger level:",
829
+ # choices=[EMOTION_DEFAULT,
830
+ # "Annoyance", "Anger", "Rage"],
831
+ # value=EMOTION_DEFAULT)
832
+ # anger_level_radio.change(update_foo,
833
+ # inputs=[anger_level_radio, anger_level_state],
834
+ # outputs=[anger_level_state])
835
 
836
  with gr.Tab("Max words"):
837
  num_words_slider = gr.Slider(label="Max number of words to generate (0 for don't care)",
 
842
 
843
  gr.HTML(AUTHORS)
844
 
 
 
 
 
 
 
 
 
 
 
 
845
  gr.HTML("""<center>
846
+ <a href="https://huggingface.co/spaces/gfhayworth/chat_qa_demo?duplicate=true">
847
  <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
848
  Powered by <a href='https://github.com/hwchase17/langchain'>LangChain 🦜️🔗</a>
849
  </center>""")