|
119 | 119 | }, |
120 | 120 | { |
121 | 121 | "cell_type": "code", |
122 | | - "execution_count": 2, |
| 122 | + "execution_count": null, |
123 | 123 | "metadata": {}, |
124 | 124 | "outputs": [ |
125 | 125 | { |
|
141 | 141 | } |
142 | 142 | ], |
143 | 143 | "source": [ |
144 | | - "import os\n", |
| 144 | + "\n", |
| 145 | + "#import os\n", |
145 | 146 | "import time\n", |
146 | 147 | "from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings\n", |
147 | 148 | "from llama_index.llms.llama_cpp import LlamaCPP\n", |
|
379 | 380 | ")\n", |
380 | 381 | "# --- END MODIFICATION ---\n", |
381 | 382 | "\n", |
382 | | - "print(\"Query engine is ready (with custom anti-leak prompt).\")" |
| 383 | + "print(\"Query engine is ready (with custom anti-leak prompt).\")\n" |
383 | 384 | ] |
384 | 385 | }, |
385 | 386 | { |
|
398 | 399 | }, |
399 | 400 | { |
400 | 401 | "cell_type": "code", |
401 | | - "execution_count": null, |
| 402 | + "execution_count": 4, |
402 | 403 | "metadata": {}, |
403 | 404 | "outputs": [ |
404 | 405 | { |
|
411 | 412 | "--- Query Engine Ready (Tracking Emissions) ---\n", |
412 | 413 | "Type 'exit' to quit.\n", |
413 | 414 | "\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" |
415 | 454 | ] |
416 | 455 | } |
417 | 456 | ], |
|
459 | 498 | " f\"Total Energy Consumed: {tracker.final_emissions_data.energy_consumed * 1000:.4f} Wh\"\n", |
460 | 499 | " )\n", |
461 | 500 | " 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" |
463 | 502 | ] |
464 | 503 | } |
465 | 504 | ], |
|
0 commit comments