Spaces:
Running
Running
Julien Delavande
commited on
Commit
·
7aee319
1
Parent(s):
aaecac2
final estimation
Browse files
src/lib/components/chat/ChatMessage.svelte
CHANGED
@@ -204,7 +204,7 @@
|
|
204 |
<div
|
205 |
class="text-xs text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800 px-3 py-1 rounded w-fit"
|
206 |
>
|
207 |
-
|
208 |
</div>
|
209 |
{/if}
|
210 |
{#if message.metadata?.duration_seconds}
|
|
|
204 |
<div
|
205 |
class="text-xs text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800 px-3 py-1 rounded w-fit"
|
206 |
>
|
207 |
+
{message.metadata.energy_wh} Wh
|
208 |
</div>
|
209 |
{/if}
|
210 |
{#if message.metadata?.duration_seconds}
|
src/lib/server/textGeneration/generate.ts
CHANGED
@@ -130,8 +130,10 @@ Do not use prefixes such as Response: or Answer: when answering to the user.`,
|
|
130 |
|
131 |
// simulation of metadata
|
132 |
const durationInSeconds = (new Date().getTime() - startTime.getTime()) / 1000;
|
133 |
-
const energyUsedwh = +(50 * (durationInSeconds / 3600)).toFixed(6); // 50W is a guess
|
134 |
|
|
|
|
|
|
|
135 |
yield {
|
136 |
type: MessageUpdateType.Metadata,
|
137 |
key: "energy_wh",
|
|
|
130 |
|
131 |
// simulation of metadata
|
132 |
const durationInSeconds = (new Date().getTime() - startTime.getTime()) / 1000;
|
|
|
133 |
|
134 |
+
// LLama 3.1 8B uses 17.38 Wh for 1000 queries according to https://huggingface.co/spaces/AIEnergyScore/Leaderboard
|
135 |
+
|
136 |
+
const energyUsedwh = +(50 * (durationInSeconds / 3600)).toFixed(6); // Using P = 50W (H100 can use up to 700W)
|
137 |
yield {
|
138 |
type: MessageUpdateType.Metadata,
|
139 |
key: "energy_wh",
|