baconnier commited on
Commit
32b7feb
1 Parent(s): e5b6eb7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -33
app.py CHANGED
@@ -106,36 +106,47 @@ class GradioInterface:
106
 
107
  # Define custom CSS for containers
108
  custom_css = """
109
- .container {
110
- border: 2px solid #2196F3;
111
- border-radius: 10px;
112
- padding: 20px;
113
- margin: 15px;
114
- background: white;
115
- position: relative;
116
- }
117
-
118
- /* Remove Gradio's default container styling */
119
- .gradio-container {
120
- background: none !important;
121
- border: none !important;
122
- box-shadow: none !important;
123
- }
124
-
125
- /* Remove default input container styling */
126
- .input-container > div:first-child {
127
- border: none !important;
128
- background: none !important;
129
- box-shadow: none !important;
130
- }
131
-
132
- /* Keep textbox styling but remove container */
133
- .textbox {
134
- border: 1px solid #ddd !important;
135
- background: white !important;
136
- box-shadow: none !important;
137
- }
138
- """
 
 
 
 
 
 
 
 
 
 
 
139
 
140
  with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as self.interface:
141
  # Title Container
@@ -145,10 +156,10 @@ class GradioInterface:
145
  gr.Markdown("Learn how to generate an improved version of your prompts. Enter a main idea for a prompt, choose a meta prompt, and the model will attempt to generate an improved version.")
146
 
147
  # Input Container
148
- with gr.Column(elem_classes=["container","input-container"]):
149
  prompt_text = gr.Textbox(
150
  label="Type the prompt (or let it empty to see metaprompt)",
151
- # elem_classes="no-background"
152
  )
153
  with gr.Accordion("Meta Prompt explanation", open=False):
154
  gr.Markdown(explanation_markdown)
@@ -156,7 +167,7 @@ class GradioInterface:
156
  ["star","done","physics","morphosis", "verse", "phor","bolism","math","arpe"],
157
  label="Choose Meta Prompt",
158
  value="star",
159
- # elem_classes=["no-background", "radio-group"]
160
  )
161
  refine_button = gr.Button("Refine Prompt")
162
 
 
106
 
107
  # Define custom CSS for containers
108
  custom_css = """
109
+ .container {
110
+ border: 2px solid #2196F3;
111
+ border-radius: 10px;
112
+ padding: 20px;
113
+ margin: 15px;
114
+ background: white;
115
+ position: relative;
116
+ }
117
+
118
+ .container::before {
119
+ position: absolute;
120
+ top: -12px;
121
+ left: 20px;
122
+ background: white;
123
+ padding: 0 10px;
124
+ color: #2196F3;
125
+ font-weight: bold;
126
+ font-size: 1.2em;
127
+ }
128
+
129
+ /* Remove default Gradio styles */
130
+ .no-background > div:first-child {
131
+ border: none !important;
132
+ background: transparent !important;
133
+ box-shadow: none !important;
134
+ }
135
+
136
+ .title-container::before { content: 'PROMPT++'; }
137
+ .input-container::before { content: 'PROMPT REFINEMENT'; }
138
+ .analysis-container::before { content: 'ANALYSIS & REFINEMENT'; }
139
+ .model-container::before { content: 'MODEL APPLICATION'; }
140
+ .results-container::before { content: 'RESULTS'; }
141
+ .examples-container::before { content: 'EXAMPLES'; }
142
+
143
+ /* Custom styling for radio buttons */
144
+ .radio-group {
145
+ display: flex;
146
+ gap: 10px;
147
+ margin: 10px 0;
148
+ }
149
+ """
150
 
151
  with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as self.interface:
152
  # Title Container
 
156
  gr.Markdown("Learn how to generate an improved version of your prompts. Enter a main idea for a prompt, choose a meta prompt, and the model will attempt to generate an improved version.")
157
 
158
  # Input Container
159
+ with gr.Column(elem_classes=["container", "input-container"]):
160
  prompt_text = gr.Textbox(
161
  label="Type the prompt (or let it empty to see metaprompt)",
162
+ elem_classes="no-background"
163
  )
164
  with gr.Accordion("Meta Prompt explanation", open=False):
165
  gr.Markdown(explanation_markdown)
 
167
  ["star","done","physics","morphosis", "verse", "phor","bolism","math","arpe"],
168
  label="Choose Meta Prompt",
169
  value="star",
170
+ elem_classes=["no-background", "radio-group"]
171
  )
172
  refine_button = gr.Button("Refine Prompt")
173