Skip to content

Commit cf89901

Browse files
committed
updates
1 parent 5bb0963 commit cf89901

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

google-gemma/gemma.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
],
259259
"source": [
260260
"# Cell 1\n",
261-
"!pip install --upgrade huggingface_hub sentence-transformers codecarbon pypdf torch scikit-learn pandas\n"
261+
"!pip install --upgrade huggingface_hub sentence-transformers codecarbon pypdf torch scikit-learn pandas"
262262
]
263263
},
264264
{
@@ -295,7 +295,6 @@
295295
"import time\n",
296296
"import textwrap\n",
297297
"import glob\n",
298-
"import pandas as pd\n",
299298
"import numpy as np\n",
300299
"from huggingface_hub import InferenceClient\n",
301300
"from sentence_transformers import SentenceTransformer\n",
@@ -322,7 +321,7 @@
322321
"print(\"Data folder:\", DATA_PATH)\n",
323322
"print(\"Answer log file:\", LOG_FILE)\n",
324323
"print(\"Emissions log file:\", EMISSIONS_FILE)\n",
325-
"print(\"API key loaded?\", (HF_API_KEY[:10] + \"...\") if HF_API_KEY else \"MISSING\")\n"
324+
"print(\"API key loaded?\", (HF_API_KEY[:10] + \"...\") if HF_API_KEY else \"MISSING\")"
326325
]
327326
},
328327
{
@@ -369,7 +368,7 @@
369368
")\n",
370369
"REFINER_USER_TEMPLATE = \"Original Draft:\\n{draft}\\n\\nCritic's Feedback:\\n{feedback}\"\n",
371370
"\n",
372-
"print(\"Prompts ready to use.\")\n"
371+
"print(\"Prompts ready to use.\")"
373372
]
374373
},
375374
{
@@ -424,6 +423,7 @@
424423
"source": [
425424
"# Cell 4\n",
426425
"\n",
426+
"\n",
427427
"class Node:\n",
428428
" def __init__(self, content, doc_id, chunk_id, fname=None):\n",
429429
" self._content = content\n",
@@ -494,6 +494,8 @@
494494
" sims = embeddings_norm @ q_emb\n",
495495
" topk_idx = np.argsort(-sims)[:k]\n",
496496
" return [nodes[i] for i in topk_idx]\n",
497+
"\n",
498+
"\n",
497499
"print(\"Retriever function ready to use.\")"
498500
]
499501
},
@@ -573,7 +575,7 @@
573575
"print(\"\\nRunning a tiny API test...\")\n",
574576
"test_prompt = \"Who was the first person on the Moon?\"\n",
575577
"resp = call_hf_api(\"You are a helpful assistant.\", test_prompt, max_tokens=60)\n",
576-
"print(\"\\n--- Test response ---\\n\", resp)\n"
578+
"print(\"\\n--- Test response ---\\n\", resp)"
577579
]
578580
},
579581
{
@@ -2060,7 +2062,7 @@
20602062
" total_emissions = tracker.stop()\n",
20612063
" print(\"\\n Total Emissions Summary:\")\n",
20622064
" print(f\"{total_emissions * 1000:.6f} gCO2eq\")\n",
2063-
" print(\"Notebook finished.\")\n"
2065+
" print(\"Notebook finished.\")"
20642066
]
20652067
}
20662068
],

0 commit comments

Comments
 (0)