Skip to content

Commit 37835cb

Browse files
committed
notebook
1 parent 6b510c2 commit 37835cb

1 file changed

Lines changed: 45 additions & 6 deletions

File tree

mistral7b/model_rag_carbon.ipynb

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
},
120120
{
121121
"cell_type": "code",
122-
"execution_count": 2,
122+
"execution_count": null,
123123
"metadata": {},
124124
"outputs": [
125125
{
@@ -141,7 +141,8 @@
141141
}
142142
],
143143
"source": [
144-
"import os\n",
144+
"\n",
145+
"#import os\n",
145146
"import time\n",
146147
"from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings\n",
147148
"from llama_index.llms.llama_cpp import LlamaCPP\n",
@@ -379,7 +380,7 @@
379380
")\n",
380381
"# --- END MODIFICATION ---\n",
381382
"\n",
382-
"print(\"Query engine is ready (with custom anti-leak prompt).\")"
383+
"print(\"Query engine is ready (with custom anti-leak prompt).\")\n"
383384
]
384385
},
385386
{
@@ -398,7 +399,7 @@
398399
},
399400
{
400401
"cell_type": "code",
401-
"execution_count": null,
402+
"execution_count": 4,
402403
"metadata": {},
403404
"outputs": [
404405
{
@@ -411,7 +412,45 @@
411412
"--- Query Engine Ready (Tracking Emissions) ---\n",
412413
"Type 'exit' to quit.\n",
413414
"\n",
414-
"Assistant: "
415+
"Assistant: \n",
416+
"The Apollo program was a human spaceflight initiative undertaken by NASA, the United States' space agency, which accomplished landing the first humans on the Moon on July 20, 1969."
417+
]
418+
},
419+
{
420+
"name": "stderr",
421+
"output_type": "stream",
422+
"text": [
423+
"llama_perf_context_print: load time = 64928.24 ms\n",
424+
"llama_perf_context_print: prompt eval time = 0.00 ms / 1870 tokens ( 0.00 ms per token, inf tokens per second)\n",
425+
"llama_perf_context_print: eval time = 0.00 ms / 46 runs ( 0.00 ms per token, inf tokens per second)\n",
426+
"llama_perf_context_print: total time = 85873.56 ms / 1916 tokens\n"
427+
]
428+
},
429+
{
430+
"name": "stdout",
431+
"output_type": "stream",
432+
"text": [
433+
"\n",
434+
"\n",
435+
"--- Query Metrics ---\n",
436+
"Latency: 86.03 seconds\n",
437+
"Emissions: 1.050614 gCO2eq\n",
438+
"Energy: 1.842194 Wh\n",
439+
"--------------------------------------------------\n",
440+
"\n",
441+
"\n",
442+
"--- Total Emissions Summary (Session) ---\n",
443+
"Total Energy Consumed: 2.1555 Wh\n",
444+
"Total CO2 Emitted: 1.2293 gCO2eq\n",
445+
"Full report saved to 'emissions.csv'\n"
446+
]
447+
},
448+
{
449+
"name": "stderr",
450+
"output_type": "stream",
451+
"text": [
452+
"c:\\Users\\engam\\anaconda3\\Lib\\site-packages\\codecarbon\\output_methods\\file.py:94: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
453+
" df = pd.concat([df, new_df], ignore_index=True)\n"
415454
]
416455
}
417456
],
@@ -459,7 +498,7 @@
459498
" f\"Total Energy Consumed: {tracker.final_emissions_data.energy_consumed * 1000:.4f} Wh\"\n",
460499
" )\n",
461500
" print(f\"Total CO2 Emitted: {total_emissions_kg * 1000:.4f} gCO2eq\")\n",
462-
" print(\"Full report saved to 'emissions.csv'\")"
501+
" print(\"Full report saved to 'emissions.csv'\")\n"
463502
]
464503
}
465504
],

0 commit comments

Comments
 (0)