Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -106,36 +106,47 @@ class GradioInterface:
|
|
| 106 |
|
| 107 |
# Define custom CSS for containers
|
| 108 |
custom_css = """
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 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 |
-
|
| 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 |
-
|
| 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 |
|