Commit
Β·
5442884
1
Parent(s):
5f47787
update app
Browse files- app.py +11 -2
- ticket-predictions.csv +6 -0
app.py
CHANGED
|
@@ -83,6 +83,15 @@ def gradio_predict(option, text_input, file_input):
|
|
| 83 |
def clear_inputs():
|
| 84 |
return "Enter Text", "", None, "", None
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
# Gradio App UI
|
| 87 |
with gr.Blocks(css=".gradio-container {max-width: 1100px; margin: auto;}") as app:
|
| 88 |
gr.Markdown(
|
|
@@ -100,7 +109,7 @@ with gr.Blocks(css=".gradio-container {max-width: 1100px; margin: auto;}") as ap
|
|
| 100 |
)
|
| 101 |
|
| 102 |
with gr.Row():
|
| 103 |
-
with gr.Column(scale=1):
|
| 104 |
option = gr.Radio(["Enter Text", "Upload CSV"], label="π Choose Input Method", value="Enter Text")
|
| 105 |
|
| 106 |
text_input = gr.Textbox(
|
|
@@ -111,7 +120,7 @@ with gr.Blocks(css=".gradio-container {max-width: 1100px; margin: auto;}") as ap
|
|
| 111 |
|
| 112 |
file_input = gr.File(label="π Upload CSV (Optional)", type="filepath", visible=False)
|
| 113 |
|
| 114 |
-
with gr.Column(scale=1):
|
| 115 |
gr.Markdown("## Prediction Results") # **Title for Prediction Results**
|
| 116 |
results_output = gr.Markdown(elem_id="results-box", visible=True)
|
| 117 |
download_csv = gr.File(label="π₯ Download Predictions CSV", interactive=False)
|
|
|
|
| 83 |
def clear_inputs():
|
| 84 |
return "Enter Text", "", None, "", None
|
| 85 |
|
| 86 |
+
|
| 87 |
+
# Custom CSS to Fix UI Scaling Issues
|
| 88 |
+
custom_css = """
|
| 89 |
+
.gradio-container { max-width: 1100px !important; margin: auto !important; }
|
| 90 |
+
#title { text-align: center; font-size: 24px !important; font-weight: bold; }
|
| 91 |
+
#predict-button, #clear-button { width: 100% !important; height: 50px !important; font-size: 18px !important; }
|
| 92 |
+
#results-box { height: 320px !important; overflow-y: auto !important; background: #f9f9f9; padding: 10px; border-radius: 8px; }
|
| 93 |
+
"""
|
| 94 |
+
|
| 95 |
# Gradio App UI
|
| 96 |
with gr.Blocks(css=".gradio-container {max-width: 1100px; margin: auto;}") as app:
|
| 97 |
gr.Markdown(
|
|
|
|
| 109 |
)
|
| 110 |
|
| 111 |
with gr.Row():
|
| 112 |
+
with gr.Column(scale=1.5):
|
| 113 |
option = gr.Radio(["Enter Text", "Upload CSV"], label="π Choose Input Method", value="Enter Text")
|
| 114 |
|
| 115 |
text_input = gr.Textbox(
|
|
|
|
| 120 |
|
| 121 |
file_input = gr.File(label="π Upload CSV (Optional)", type="filepath", visible=False)
|
| 122 |
|
| 123 |
+
with gr.Column(scale=1.5):
|
| 124 |
gr.Markdown("## Prediction Results") # **Title for Prediction Results**
|
| 125 |
results_output = gr.Markdown(elem_id="results-box", visible=True)
|
| 126 |
download_csv = gr.File(label="π₯ Download Predictions CSV", interactive=False)
|
ticket-predictions.csv
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Index,Description,Assigned Team,Team Email
|
| 2 |
+
1,Database queries not optimized for large datasets.,Code Review Team,[email protected]
|
| 3 |
+
2,User authentication fails when accessing restricted sections.,Functional Team,[email protected]
|
| 4 |
+
3,High CPU utilization leading to system overheating and slow performance.,Performance Team,[email protected]
|
| 5 |
+
4,System crashes due to misconfigured runtime environments.,Infrastructure Team,[email protected]
|
| 6 |
+
5,Unauthorized access detected in restricted sections of the application.,Security Team,[email protected]
|