Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- app.py +1 -0
- static/index.css +5 -1
- templates/index.html +1 -4
app.py
CHANGED
|
@@ -133,6 +133,7 @@ def build_results_markup(text_input: str) -> str:
|
|
| 133 |
predicted_class_id = pipeline_output['label']
|
| 134 |
probability = pipeline_output['score']
|
| 135 |
sentiment_name = CLASS_ID_TO_SENTIMENT[predicted_class_id]
|
|
|
|
| 136 |
|
| 137 |
results_html += render_model_result("BERTweet (Transformer)", sentiment_name, probability)
|
| 138 |
|
|
|
|
| 133 |
predicted_class_id = pipeline_output['label']
|
| 134 |
probability = pipeline_output['score']
|
| 135 |
sentiment_name = CLASS_ID_TO_SENTIMENT[predicted_class_id]
|
| 136 |
+
logger.info(f"BERTweet prediction: {text_input} -> {sentiment_name} ({probability:.4f})")
|
| 137 |
|
| 138 |
results_html += render_model_result("BERTweet (Transformer)", sentiment_name, probability)
|
| 139 |
|
static/index.css
CHANGED
|
@@ -4,11 +4,15 @@ body {
|
|
| 4 |
|
| 5 |
.results-grid {
|
| 6 |
display: grid;
|
| 7 |
-
grid-template-columns: repeat(auto-fit, minmax(
|
| 8 |
gap: 1rem;
|
| 9 |
margin-top: 1.25rem;
|
| 10 |
}
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
.model-result {
|
| 13 |
padding: 1.25rem;
|
| 14 |
border-radius: 1rem;
|
|
|
|
| 4 |
|
| 5 |
.results-grid {
|
| 6 |
display: grid;
|
| 7 |
+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
| 8 |
gap: 1rem;
|
| 9 |
margin-top: 1.25rem;
|
| 10 |
}
|
| 11 |
|
| 12 |
+
.model-result:first-child {
|
| 13 |
+
grid-column: 1/5;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
.model-result {
|
| 17 |
padding: 1.25rem;
|
| 18 |
border-radius: 1rem;
|
templates/index.html
CHANGED
|
@@ -50,11 +50,8 @@
|
|
| 50 |
|
| 51 |
<aside class="rounded-2xl border border-slate-200 bg-slate-50/80 p-6 shadow-sm lg:self-start">
|
| 52 |
<h2 class="text-lg font-semibold text-slate-800">
|
| 53 |
-
|
| 54 |
</h2>
|
| 55 |
-
<p class="mt-2 text-sm text-slate-500">
|
| 56 |
-
Tap to load a prompt instantly.
|
| 57 |
-
</p>
|
| 58 |
<ul class="mt-5 space-y-2">
|
| 59 |
{% for preset in presets %}
|
| 60 |
<li>
|
|
|
|
| 50 |
|
| 51 |
<aside class="rounded-2xl border border-slate-200 bg-slate-50/80 p-6 shadow-sm lg:self-start">
|
| 52 |
<h2 class="text-lg font-semibold text-slate-800">
|
| 53 |
+
Examples
|
| 54 |
</h2>
|
|
|
|
|
|
|
|
|
|
| 55 |
<ul class="mt-5 space-y-2">
|
| 56 |
{% for preset in presets %}
|
| 57 |
<li>
|