Update app.py
Browse files
app.py
CHANGED
@@ -44,33 +44,31 @@ footer {display:none !important}
|
|
44 |
box-shadow: none !important;
|
45 |
}
|
46 |
.gr-button-primary:hover{
|
47 |
-
z-index: 14;
|
48 |
-
height: 43px;
|
49 |
-
width: 130px;
|
50 |
-
left: 0px;
|
51 |
-
top: 0px;
|
52 |
-
padding: 0px;
|
53 |
-
cursor: pointer !important;
|
54 |
background: none rgb(66, 133, 244) !important;
|
55 |
-
border: none !important;
|
56 |
-
text-align: center !important;
|
57 |
-
font-family: Poppins !important;
|
58 |
-
font-size: 14px !important;
|
59 |
-
font-weight: 500 !important;
|
60 |
-
color: rgb(255, 255, 255) !important;
|
61 |
-
line-height: 1 !important;
|
62 |
-
border-radius: 12px !important;
|
63 |
-
transition: box-shadow 200ms ease 0s, background 200ms ease 0s !important;
|
64 |
box-shadow: rgb(0 0 0 / 23%) 0px 1px 7px 0px !important;
|
65 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
"""
|
67 |
|
68 |
iface = gr.Interface(
|
69 |
fn=classify_text,
|
70 |
inputs=[
|
71 |
gr.Dropdown(AVAILABLE_MODELS, label="Choose Model"),
|
72 |
-
gr.
|
73 |
-
|
|
|
|
|
74 |
],
|
75 |
outputs=gr.Label(label="Classification Scores"),
|
76 |
title="Zero-Shot Text Classifier",
|
@@ -82,3 +80,4 @@ iface = gr.Interface(
|
|
82 |
# Launch the app
|
83 |
if __name__ == "__main__":
|
84 |
iface.launch()
|
|
|
|
44 |
box-shadow: none !important;
|
45 |
}
|
46 |
.gr-button-primary:hover{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
background: none rgb(66, 133, 244) !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
box-shadow: rgb(0 0 0 / 23%) 0px 1px 7px 0px !important;
|
49 |
}
|
50 |
+
|
51 |
+
/* Two-column layout for text and labels */
|
52 |
+
.gr-blocks-container {
|
53 |
+
display: flex;
|
54 |
+
gap: 20px;
|
55 |
+
}
|
56 |
+
.gr-blocks-container .gr-block:first-child {
|
57 |
+
flex: 1;
|
58 |
+
}
|
59 |
+
.gr-blocks-container .gr-block:last-child {
|
60 |
+
flex: 1;
|
61 |
+
}
|
62 |
"""
|
63 |
|
64 |
iface = gr.Interface(
|
65 |
fn=classify_text,
|
66 |
inputs=[
|
67 |
gr.Dropdown(AVAILABLE_MODELS, label="Choose Model"),
|
68 |
+
gr.Row([
|
69 |
+
gr.Textbox(label="Enter Text", placeholder="Type or paste text here..."),
|
70 |
+
gr.Textbox(label="Enter Labels (comma-separated)", placeholder="e.g., sports, politics, technology")
|
71 |
+
])
|
72 |
],
|
73 |
outputs=gr.Label(label="Classification Scores"),
|
74 |
title="Zero-Shot Text Classifier",
|
|
|
80 |
# Launch the app
|
81 |
if __name__ == "__main__":
|
82 |
iface.launch()
|
83 |
+
|