Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,11 +2,10 @@ import gradio as gr
|
|
| 2 |
from RAG_AGENT import gemini_explain_file, extract_clean_pdf_text
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
# Fixed minimalist dark CSS
|
| 6 |
css = """
|
| 7 |
.gradio-container {
|
| 8 |
font-family: 'Inter', sans-serif;
|
| 9 |
-
max-width:
|
| 10 |
margin: auto;
|
| 11 |
padding: 2rem;
|
| 12 |
background-color: #121212;
|
|
@@ -56,10 +55,11 @@ css = """
|
|
| 56 |
border-radius: 10px;
|
| 57 |
padding: 1.5rem;
|
| 58 |
border: 1px solid #333;
|
| 59 |
-
min-height:
|
| 60 |
font-size: 1rem;
|
| 61 |
line-height: 1.6;
|
| 62 |
color: #e0e0e0;
|
|
|
|
| 63 |
}
|
| 64 |
|
| 65 |
.footer {
|
|
@@ -99,38 +99,39 @@ with gr.Blocks(css=css, title="Science Analyzer - Dark UI") as demo:
|
|
| 99 |
</div>
|
| 100 |
""")
|
| 101 |
|
| 102 |
-
with gr.
|
| 103 |
-
with gr.
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 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 |
gr.HTML("""
|
| 136 |
<div class="footer">
|
|
|
|
| 2 |
from RAG_AGENT import gemini_explain_file, extract_clean_pdf_text
|
| 3 |
import os
|
| 4 |
|
|
|
|
| 5 |
css = """
|
| 6 |
.gradio-container {
|
| 7 |
font-family: 'Inter', sans-serif;
|
| 8 |
+
max-width: 850px !important;
|
| 9 |
margin: auto;
|
| 10 |
padding: 2rem;
|
| 11 |
background-color: #121212;
|
|
|
|
| 55 |
border-radius: 10px;
|
| 56 |
padding: 1.5rem;
|
| 57 |
border: 1px solid #333;
|
| 58 |
+
min-height: 250px;
|
| 59 |
font-size: 1rem;
|
| 60 |
line-height: 1.6;
|
| 61 |
color: #e0e0e0;
|
| 62 |
+
margin-top: 2rem;
|
| 63 |
}
|
| 64 |
|
| 65 |
.footer {
|
|
|
|
| 99 |
</div>
|
| 100 |
""")
|
| 101 |
|
| 102 |
+
with gr.Column():
|
| 103 |
+
with gr.Row():
|
| 104 |
+
with gr.Column():
|
| 105 |
+
file_input = gr.File(
|
| 106 |
+
label="π Upload File",
|
| 107 |
+
file_types=[".pdf", ".png", ".jpg", ".jpeg"],
|
| 108 |
+
file_count="single",
|
| 109 |
+
elem_classes=["upload-area"]
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
analysis_type = gr.Radio(
|
| 113 |
+
choices=["AI Analysis", "Extract PDF Text"],
|
| 114 |
+
value="AI Analysis",
|
| 115 |
+
label="π Analysis Type"
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
question_input = gr.Textbox(
|
| 119 |
+
label="Ask a Question (Optional)",
|
| 120 |
+
placeholder="Type your question here...",
|
| 121 |
+
lines=2
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
analyze_btn = gr.Button(
|
| 125 |
+
"π Analyze",
|
| 126 |
+
variant="primary",
|
| 127 |
+
elem_classes=["btn-primary"]
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
output_box = gr.Markdown(
|
| 131 |
+
value="π Upload a file and click Analyze.",
|
| 132 |
+
elem_id="custom-output",
|
| 133 |
+
show_label=False
|
| 134 |
+
)
|
| 135 |
|
| 136 |
gr.HTML("""
|
| 137 |
<div class="footer">
|