Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,17 +5,13 @@ from transformers import (
|
|
| 5 |
AutoModelForSequenceClassification
|
| 6 |
)
|
| 7 |
|
| 8 |
-
|
| 9 |
-
# Model loading (UNCHANGED)
|
| 10 |
-
# =========================
|
| 11 |
MODEL_NAME = "duclo90/results"
|
| 12 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
|
| 13 |
model = AutoModelForSequenceClassification.from_pretrained(MODEL_NAME)
|
| 14 |
model.eval()
|
| 15 |
|
| 16 |
-
|
| 17 |
-
# Inference logic (UNCHANGED)
|
| 18 |
-
# =========================
|
| 19 |
def classify_text(text):
|
| 20 |
if not text.strip():
|
| 21 |
return """
|
|
@@ -95,9 +91,7 @@ def classify_text(text):
|
|
| 95 |
</style>
|
| 96 |
"""
|
| 97 |
|
| 98 |
-
|
| 99 |
-
# CSS (ONLY UI REMOVALS)
|
| 100 |
-
# =========================
|
| 101 |
custom_css = """
|
| 102 |
/* Remove Gradio top bar, API button, settings, footer */
|
| 103 |
header,
|
|
@@ -166,9 +160,7 @@ button {
|
|
| 166 |
}
|
| 167 |
"""
|
| 168 |
|
| 169 |
-
|
| 170 |
-
# Interface (UNCHANGED)
|
| 171 |
-
# =========================
|
| 172 |
iface = gr.Interface(
|
| 173 |
fn=classify_text,
|
| 174 |
inputs=gr.Textbox(
|
|
@@ -183,9 +175,7 @@ iface = gr.Interface(
|
|
| 183 |
flagging_mode="never"
|
| 184 |
)
|
| 185 |
|
| 186 |
-
|
| 187 |
-
# Launch
|
| 188 |
-
# =========================
|
| 189 |
iface.launch(
|
| 190 |
theme=gr.themes.Soft(
|
| 191 |
primary_hue="purple",
|
|
|
|
| 5 |
AutoModelForSequenceClassification
|
| 6 |
)
|
| 7 |
|
| 8 |
+
|
|
|
|
|
|
|
| 9 |
MODEL_NAME = "duclo90/results"
|
| 10 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
|
| 11 |
model = AutoModelForSequenceClassification.from_pretrained(MODEL_NAME)
|
| 12 |
model.eval()
|
| 13 |
|
| 14 |
+
|
|
|
|
|
|
|
| 15 |
def classify_text(text):
|
| 16 |
if not text.strip():
|
| 17 |
return """
|
|
|
|
| 91 |
</style>
|
| 92 |
"""
|
| 93 |
|
| 94 |
+
|
|
|
|
|
|
|
| 95 |
custom_css = """
|
| 96 |
/* Remove Gradio top bar, API button, settings, footer */
|
| 97 |
header,
|
|
|
|
| 160 |
}
|
| 161 |
"""
|
| 162 |
|
| 163 |
+
|
|
|
|
|
|
|
| 164 |
iface = gr.Interface(
|
| 165 |
fn=classify_text,
|
| 166 |
inputs=gr.Textbox(
|
|
|
|
| 175 |
flagging_mode="never"
|
| 176 |
)
|
| 177 |
|
| 178 |
+
|
|
|
|
|
|
|
| 179 |
iface.launch(
|
| 180 |
theme=gr.themes.Soft(
|
| 181 |
primary_hue="purple",
|