Update app.py
Browse files
app.py
CHANGED
@@ -59,30 +59,8 @@ def respond(message, history, name, char_class, char_alignment):
|
|
59 |
|
60 |
chat_css="""
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
}
|
65 |
-
|
66 |
-
#alignment_radio label {
|
67 |
-
display: flex !important;
|
68 |
-
align-items: center;
|
69 |
-
justify-content: center;
|
70 |
-
aspect-ratio: 1 / 1;
|
71 |
-
background-color: #eee;
|
72 |
-
border: 1px solid #ccc;
|
73 |
-
font-size: 0.75rem;
|
74 |
-
margin: 0 !important;
|
75 |
-
padding: 0 !important;
|
76 |
-
cursor: pointer;
|
77 |
-
user-select: none;
|
78 |
-
transition: background-color 0.2s, color 0.2s;
|
79 |
-
}
|
80 |
-
|
81 |
-
/* This is the magic: target the label of the checked input */
|
82 |
-
#alignment_radio input[type="radio"]:checked + label {
|
83 |
-
background-color: red !important;
|
84 |
-
color: white !important;
|
85 |
-
border-color: darkred !important;
|
86 |
}
|
87 |
"""
|
88 |
|
@@ -95,24 +73,24 @@ with gr.Blocks(css=chat_css) as chatbot:
|
|
95 |
show_share_button=False,
|
96 |
show_download_button=False
|
97 |
)
|
98 |
-
with gr.Column(scale=
|
99 |
-
gr.Markdown("""# Character
|
100 |
|
101 |
with gr.Row():
|
102 |
|
103 |
with gr.Column(scale=1):
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
|
118 |
chatbot.launch()
|
|
|
59 |
|
60 |
chat_css="""
|
61 |
|
62 |
+
.alignment_radio{
|
63 |
+
color: red;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
"""
|
66 |
|
|
|
73 |
show_share_button=False,
|
74 |
show_download_button=False
|
75 |
)
|
76 |
+
with gr.Column(scale=5):
|
77 |
+
gr.Markdown("""# Gorf's Character Creator""")
|
78 |
|
79 |
with gr.Row():
|
80 |
|
81 |
with gr.Column(scale=1):
|
82 |
+
|
83 |
+
# character_name = gr.Textbox(label = "Character Name", placeholder="Type your name here…", info ="optional")
|
84 |
+
# character_class = gr.CheckboxGroup(['Barbarian', 'Bard', 'Cleric', 'Druid', 'Fighter', 'Monk', 'Paladin', 'Ranger', 'Rogue', 'Sorcerer', 'Warlock', 'Wizard'], label="Character Class", info="Choose one or more")
|
85 |
+
# character_alignment = gr.Radio(["Lawful Good", "Neutral Good", "Chaotic Good", "Lawful Neutral", "True Neutral", "Chaotic Neutral", "Lawful Evil", "Neutral Evil", "Chaotic Evil"], elem_classes="alignment_radio")
|
86 |
+
with gr.Column(scale=1):
|
87 |
+
# gr.ChatInterface(
|
88 |
+
# fn=respond,
|
89 |
+
# additional_inputs=[character_name, character_class, character_alignment], # Pass name into function!
|
90 |
+
# type="messages",
|
91 |
+
# examples=None,
|
92 |
+
# title="Character Creator",
|
93 |
+
# description="Welcome! Tell me what you want to create and we can make your character come to life!"
|
94 |
+
# )
|
95 |
|
96 |
chatbot.launch()
|