Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from huggingface_hub.utils import EntryNotFoundError
|
|
| 8 |
|
| 9 |
# ββ Konfiguration ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 10 |
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 11 |
-
DATASET_REPO = os.environ.get("DATASET_REPO", "")
|
| 12 |
DATASET_FILE = "data.jsonl"
|
| 13 |
MODEL_ID = "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8"
|
| 14 |
LEADERBOARD_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "leaderboard.json")
|
|
@@ -27,7 +27,7 @@ Regeln:
|
|
| 27 |
- Alles ist ausnahmslos positiv, auch wenn das Original negativ ist
|
| 28 |
- Hashtags am Ende sind Pflicht (mindestens 5)
|
| 29 |
- Klingt wie jemand, der gerade ein Buch ΓΌber sich selbst schreiben wΓΌrde
|
| 30 |
-
- Formatiere mit Markdown: ErΓΆffnungssatz als ##
|
| 31 |
|
| 32 |
Antworte NUR mit dem LinkedIn-Post in Markdown. Kein Vorwort, keine ErklΓ€rung."""
|
| 33 |
|
|
@@ -66,9 +66,9 @@ Use exactly this structure:
|
|
| 66 |
|
| 67 |
Rules:
|
| 68 |
- score is an integer 1-10. Be calibrated: most posts will not score 8-10 on every metric. Reserve 9-10 for truly egregious cases.
|
| 69 |
-
- comment is max 5 words in German, dry and precise.
|
| 70 |
-
- verdict is one precise sentence in German, max 12 words. Acknowledge substance if present.
|
| 71 |
-
- ALL string values must be valid JSON strings.
|
| 72 |
|
| 73 |
|
| 74 |
# ββ HF Dataset Persistenz ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -197,7 +197,6 @@ def _render_leaderboard() -> str:
|
|
| 197 |
color = "#1A5C34" if pct < 40 else "#27AE60" if pct < 70 else "#E67E22"
|
| 198 |
else:
|
| 199 |
color = "#C0392B" if pct >= 70 else "#E67E22" if pct >= 40 else "#27AE60"
|
| 200 |
-
color = "#C0392B" if pct >= 70 else "#E67E22" if pct >= 40 else "#27AE60"
|
| 201 |
medal = ["π₯","π₯","π₯"] [rank] if rank < 3 else f"{rank+1}."
|
| 202 |
full = e["text"].replace("<", "<").replace(">", ">")
|
| 203 |
preview = full[:120] + ("..." if len(full) > 120 else "")
|
|
@@ -551,7 +550,7 @@ with gr.Blocks(title="LinkedIn Translator") as demo:
|
|
| 551 |
</div>
|
| 552 |
""")
|
| 553 |
|
| 554 |
-
dir_label = gr.HTML('<div class="direction-banner">
|
| 555 |
|
| 556 |
with gr.Row(equal_height=True):
|
| 557 |
with gr.Column(scale=5):
|
|
|
|
| 8 |
|
| 9 |
# ββ Konfiguration ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 10 |
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 11 |
+
DATASET_REPO = os.environ.get("DATASET_REPO", "")
|
| 12 |
DATASET_FILE = "data.jsonl"
|
| 13 |
MODEL_ID = "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8"
|
| 14 |
LEADERBOARD_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "leaderboard.json")
|
|
|
|
| 27 |
- Alles ist ausnahmslos positiv, auch wenn das Original negativ ist
|
| 28 |
- Hashtags am Ende sind Pflicht (mindestens 5)
|
| 29 |
- Klingt wie jemand, der gerade ein Buch ΓΌber sich selbst schreiben wΓΌrde
|
| 30 |
+
- Formatiere mit Markdown: ErΓΆffnungssatz als ## Γberschrift, SchlΓΌsselbegriffe wie **Gamechanger**, **Growth**, **Mindset**, **Journey** fett hervorheben, Abschnitte mit Leerzeilen trennen
|
| 31 |
|
| 32 |
Antworte NUR mit dem LinkedIn-Post in Markdown. Kein Vorwort, keine ErklΓ€rung."""
|
| 33 |
|
|
|
|
| 66 |
|
| 67 |
Rules:
|
| 68 |
- score is an integer 1-10. Be calibrated: most posts will not score 8-10 on every metric. Reserve 9-10 for truly egregious cases.
|
| 69 |
+
- comment is max 5 words in German, dry and precise.
|
| 70 |
+
- verdict is one precise sentence in German, max 12 words. Acknowledge substance if present.
|
| 71 |
+
- ALL string values must be valid JSON strings."""
|
| 72 |
|
| 73 |
|
| 74 |
# ββ HF Dataset Persistenz ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 197 |
color = "#1A5C34" if pct < 40 else "#27AE60" if pct < 70 else "#E67E22"
|
| 198 |
else:
|
| 199 |
color = "#C0392B" if pct >= 70 else "#E67E22" if pct >= 40 else "#27AE60"
|
|
|
|
| 200 |
medal = ["π₯","π₯","π₯"] [rank] if rank < 3 else f"{rank+1}."
|
| 201 |
full = e["text"].replace("<", "<").replace(">", ">")
|
| 202 |
preview = full[:120] + ("..." if len(full) > 120 else "")
|
|
|
|
| 550 |
</div>
|
| 551 |
""")
|
| 552 |
|
| 553 |
+
dir_label = gr.HTML('<div class="direction-banner">Normale Sprache → LinkedIn Speech</div>')
|
| 554 |
|
| 555 |
with gr.Row(equal_height=True):
|
| 556 |
with gr.Column(scale=5):
|