demetz commited on
Commit
ce49c48
·
verified ·
1 Parent(s): 8d08fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -39
app.py CHANGED
@@ -59,30 +59,8 @@ def respond(message, history, name, char_class, char_alignment):
59
 
60
  chat_css="""
61
 
62
- #alignment_radio input[type="radio"] {
63
- display: none;
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=3):
99
- gr.Markdown("""# Character Maker""")
100
 
101
  with gr.Row():
102
 
103
  with gr.Column(scale=1):
104
- gr.HTML("<h1>Hello from custom HTML!</h1><p>This is a paragraph.</p>")
105
- character_name = gr.Textbox(label = "Character Name", placeholder="Type your name here…", info ="optional")
106
- character_class = gr.CheckboxGroup(['Barbarian', 'Bard', 'Cleric', 'Druid', 'Fighter', 'Monk', 'Paladin', 'Ranger', 'Rogue', 'Sorcerer', 'Warlock', 'Wizard'], label="Character Class", info="Choose one or more")
107
- character_alignment = gr.Radio(["Lawful Good", "Neutral Good", "Chaotic Good", "Lawful Neutral", "True Neutral", "Chaotic Neutral", "Lawful Evil", "Neutral Evil", "Chaotic Evil"], elem_id="alignment_radio")
108
-
109
- gr.ChatInterface(
110
- fn=respond,
111
- additional_inputs=[character_name, character_class, character_alignment], # Pass name into function!
112
- type="messages",
113
- examples=None,
114
- title="Character Creator",
115
- description="Welcome! Tell me what you want to create and we can make your character come to life!"
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()