Spaces:
Paused
Paused
Commit
·
67f3082
1
Parent(s):
cdb77c2
Update app.py
Browse filesremove unused settings tabs from gradio
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>
|
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 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
with gr.Tab("Lit style"):
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
with gr.Tab("Emotions"):
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
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/
|
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>""")
|