Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -126,52 +126,68 @@ def lite_runner(topic):
|
|
126 |
# ---------------------------
|
127 |
# App UI Setup Using Gradio Soft Theme with Centered Layout
|
128 |
# ---------------------------
|
129 |
-
with gr.Blocks(
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
gr.Markdown(
|
132 |
"""
|
133 |
-
<div style="
|
134 |
-
<
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
</p>
|
145 |
</div>
|
146 |
""",
|
147 |
elem_id="header"
|
148 |
)
|
149 |
-
|
150 |
-
# (Optional) Additional state variables, tabs, and UI elements as needed.
|
151 |
-
vectordb = gr.State()
|
152 |
-
doc_collection = gr.State(value=[])
|
153 |
-
session_states = gr.State(value={})
|
154 |
-
references = gr.State(value=[])
|
155 |
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
)
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
""
|
|
|
166 |
)
|
167 |
-
|
|
|
168 |
"""
|
169 |
-
<
|
|
|
|
|
170 |
"""
|
171 |
)
|
172 |
-
|
173 |
-
# ... (The rest of your Tabs and UI components go here.)
|
174 |
-
|
175 |
-
gr.HTML('<div style="text-align: center; margin-top: 20px;">Made with ❤️ by <b>Zamal</b></div>')
|
176 |
|
177 |
demo.queue(max_size=10).launch()
|
|
|
126 |
# ---------------------------
|
127 |
# App UI Setup Using Gradio Soft Theme with Centered Layout
|
128 |
# ---------------------------
|
129 |
+
with gr.Blocks(
|
130 |
+
theme=gr.themes.Soft(text_size=sizes.text_md)),
|
131 |
+
title="DeepGit Lite",
|
132 |
+
css="""
|
133 |
+
/* Center header and footer */
|
134 |
+
#header { text-align: center; margin-bottom: 20px; }
|
135 |
+
#main-container { max-width: 800px; margin: auto; }
|
136 |
+
#footer { text-align: center; margin-top: 20px; }
|
137 |
+
"""
|
138 |
+
) as demo:
|
139 |
gr.Markdown(
|
140 |
"""
|
141 |
+
<div style="padding-top: 60px;">
|
142 |
+
<div style="display: flex; align-items: center; justify-content: center;">
|
143 |
+
<img src="https://img.icons8.com/?size=100&id=118557&format=png&color=000000" style="width: 60px; height: 60px; margin-right: 12px;">
|
144 |
+
<h1 style="margin: 0; font-size: 2.2em;">DeepGit Lite</h1>
|
145 |
+
</div>
|
146 |
+
<div style="text-align: center; margin-top: 10px;">
|
147 |
+
<p style="margin: 0;">
|
148 |
+
Explore GitHub repositories with deep semantic search.<br>
|
149 |
+
Check out our <a href="https://github.com/zamalali/DeepGit" target="_blank">GitHub</a> for more details.
|
150 |
+
</p>
|
151 |
+
</div>
|
|
|
152 |
</div>
|
153 |
""",
|
154 |
elem_id="header"
|
155 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
+
|
158 |
+
# Centered main container for inputs and outputs.
|
159 |
+
with gr.Column(elem_id="main-container"):
|
160 |
+
research_input = gr.Textbox(
|
161 |
+
label="Research Query",
|
162 |
+
placeholder="Enter your research topic here, e.g., 'data augmentation pipelines for LLM fine-tuning'",
|
163 |
+
lines=3
|
164 |
+
)
|
165 |
+
run_button = gr.Button("Run DeepGit Lite", variant="primary")
|
166 |
+
status_display = gr.Markdown(label="Status")
|
167 |
+
detail_display = gr.HTML(label="Results")
|
168 |
+
|
169 |
+
run_button.click(
|
170 |
+
fn=lite_runner,
|
171 |
+
inputs=[research_input],
|
172 |
+
outputs=[status_display, detail_display],
|
173 |
+
api_name="deepgit_lite",
|
174 |
+
show_progress=True
|
175 |
)
|
176 |
+
|
177 |
+
research_input.submit(
|
178 |
+
fn=lite_runner,
|
179 |
+
inputs=[research_input],
|
180 |
+
outputs=[status_display, detail_display],
|
181 |
+
api_name="deepgit_lite_submit",
|
182 |
+
show_progress=True
|
183 |
)
|
184 |
+
|
185 |
+
gr.HTML(
|
186 |
"""
|
187 |
+
<div id="footer">
|
188 |
+
Made with ❤️ by <b>Zamal</b>
|
189 |
+
</div>
|
190 |
"""
|
191 |
)
|
|
|
|
|
|
|
|
|
192 |
|
193 |
demo.queue(max_size=10).launch()
|