bebechien commited on
Commit
825adfe
Β·
verified Β·
1 Parent(s): 4c5fe0f

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +3 -3
  2. app.py +7 -6
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Embedding Gemma Modkit
3
  emoji: 😻
4
  colorFrom: green
5
  colorTo: indigo
@@ -9,9 +9,9 @@ app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- # πŸ€– Embedding Gemma Modkit: Fine-Tuning and Mood Reader
13
 
14
- This project provides a set of tools to fine-tune a sentence-embedding model to understand your personal taste in Hacker News titles and then use that model to score and rank new articles based on their "vibe."
15
 
16
  It includes three main applications:
17
  1. A **Gradio App** for interactive fine-tuning, evaluation, and real-time "vibe checks."
 
1
  ---
2
+ title: EmbeddingGemma Modkit
3
  emoji: 😻
4
  colorFrom: green
5
  colorTo: indigo
 
9
  pinned: false
10
  ---
11
 
12
+ # πŸ€– EmbeddingGemma Modkit: Fine-Tuning and Mood Reader
13
 
14
+ This project provides a set of tools to fine-tune EmbeddingGemma to understand your personal taste in Hacker News titles and then use it to score and rank new articles based on their "vibe."
15
 
16
  It includes three main applications:
17
  1. A **Gradio App** for interactive fine-tuning, evaluation, and real-time "vibe checks."
app.py CHANGED
@@ -288,10 +288,11 @@ class HackerNewsFineTuner:
288
 
289
  md = (f"## Hacker News Top Stories (Model: `{self.config.MODEL_NAME}`{' - Fine-tuned' if self.last_hn_dataset else ''}) ⬇️\n"
290
  f"**Last Updated:** {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n"
291
- "| Vibe | Title | Comments | Published |\n|---|---|---|---|\n")
292
 
293
  for item in scored_entries:
294
  md += (f"| {item['mood'].status_html} "
 
295
  f"| [{item['title']}]({item['link']}) "
296
  f"| [Comments]({item['comments']}) "
297
  f"| {item['published']} |\n")
@@ -300,9 +301,9 @@ class HackerNewsFineTuner:
300
 
301
  ## Gradio Interface Setup ##
302
  def build_interface(self) -> gr.Blocks:
303
- with gr.Blocks(title="Embedding Gemma Modkit") as demo:
304
- gr.Markdown("# πŸ€– Embedding Gemma Modkit: Fine-Tuning and Mood Reader")
305
- gr.Markdown("See [README](https://huggingface.co/spaces/google/embeddinggemma-modkit/blob/main/README.md) for more details.")
306
  with gr.Tab("πŸš€ Fine-Tuning & Evaluation"):
307
  self._build_training_interface()
308
  with gr.Tab("πŸ’‘ News Vibe Check"):
@@ -316,13 +317,13 @@ class HackerNewsFineTuner:
316
  gr.Markdown("## Fine-Tuning & Semantic Search\nSelect titles to fine-tune the model towards making them more similar to **`MY_FAVORITE_NEWS`**.")
317
  with gr.Row():
318
  favorite_list = gr.CheckboxGroup(self.titles, type="index", label=f"Hacker News Top {len(self.titles)}", show_select_all=True)
319
- output = gr.Textbox(lines=24, label="Training and Search Results", value="Click 'Run Fine-Tuning' to begin.")
320
  with gr.Row():
321
  clear_reload_btn = gr.Button("Clear & Reload Model/Data")
322
  run_training_btn = gr.Button("πŸš€ Run Fine-Tuning", variant="primary")
323
  gr.Markdown("--- \n ## Dataset & Model Management")
 
324
  with gr.Row():
325
- import_file = gr.File(label="Upload Additional Dataset (.csv)", file_types=[".csv"], height=50)
326
  download_dataset_btn = gr.Button("πŸ’Ύ Export Last HN Dataset")
327
  download_model_btn = gr.Button("⬇️ Download Fine-Tuned Model")
328
  download_status = gr.Markdown("Ready.")
 
288
 
289
  md = (f"## Hacker News Top Stories (Model: `{self.config.MODEL_NAME}`{' - Fine-tuned' if self.last_hn_dataset else ''}) ⬇️\n"
290
  f"**Last Updated:** {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n"
291
+ "| Vibe | Score | Title | Comments | Published |\n|---|---|---|---|---|\n")
292
 
293
  for item in scored_entries:
294
  md += (f"| {item['mood'].status_html} "
295
+ f"| {item['mood'].raw_score:.4f} "
296
  f"| [{item['title']}]({item['link']}) "
297
  f"| [Comments]({item['comments']}) "
298
  f"| {item['published']} |\n")
 
301
 
302
  ## Gradio Interface Setup ##
303
  def build_interface(self) -> gr.Blocks:
304
+ with gr.Blocks(title="EmbeddingGemma Modkit") as demo:
305
+ gr.Markdown("# πŸ€– EmbeddingGemma Modkit: Fine-Tuning and Mood Reader")
306
+ gr.Markdown("This project provides a set of tools to fine-tune EmbeddingGemma to understand your personal taste in Hacker News titles and then use it to score and rank new articles based on their \"vibe\". The core idea is to measure the \"vibe\" of a news title by calculating the semantic similarity between its embedding and the embedding of a fixed anchor phrase, **`MY_FAVORITE_NEWS`**.<br>See [README](https://huggingface.co/spaces/google/embeddinggemma-modkit/blob/main/README.md) for more details.")
307
  with gr.Tab("πŸš€ Fine-Tuning & Evaluation"):
308
  self._build_training_interface()
309
  with gr.Tab("πŸ’‘ News Vibe Check"):
 
317
  gr.Markdown("## Fine-Tuning & Semantic Search\nSelect titles to fine-tune the model towards making them more similar to **`MY_FAVORITE_NEWS`**.")
318
  with gr.Row():
319
  favorite_list = gr.CheckboxGroup(self.titles, type="index", label=f"Hacker News Top {len(self.titles)}", show_select_all=True)
320
+ output = gr.Textbox(lines=14, label="Training and Search Results", value="Click 'Run Fine-Tuning' to begin.")
321
  with gr.Row():
322
  clear_reload_btn = gr.Button("Clear & Reload Model/Data")
323
  run_training_btn = gr.Button("πŸš€ Run Fine-Tuning", variant="primary")
324
  gr.Markdown("--- \n ## Dataset & Model Management")
325
+ import_file = gr.File(label="Upload Additional Dataset (.csv)", file_types=[".csv"], height=50)
326
  with gr.Row():
 
327
  download_dataset_btn = gr.Button("πŸ’Ύ Export Last HN Dataset")
328
  download_model_btn = gr.Button("⬇️ Download Fine-Tuned Model")
329
  download_status = gr.Markdown("Ready.")