aidn commited on
Commit
ccfc4ef
Β·
verified Β·
1 Parent(s): 34ff5a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
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", "") # z.B. "mein-name/linkedin-nonsense-dataset"
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 ## Ueberschrift, 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,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. Use only basic ASCII characters, no special chars, no umlauts.
70
- - verdict is one precise sentence in German, max 12 words. Acknowledge substance if present. Use only basic ASCII characters.
71
- - ALL string values must be valid JSON strings. Plain ASCII only."""
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("<", "&lt;").replace(">", "&gt;")
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">Modus: Normale Sprache &rarr; LinkedIn Speech</div>')
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("<", "&lt;").replace(">", "&gt;")
202
  preview = full[:120] + ("..." if len(full) > 120 else "")
 
550
  </div>
551
  """)
552
 
553
+ dir_label = gr.HTML('<div class="direction-banner">Normale Sprache &rarr; LinkedIn Speech</div>')
554
 
555
  with gr.Row(equal_height=True):
556
  with gr.Column(scale=5):