Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
8442ad4
1
Parent(s):
47fac84
src/lib/server/textGeneration/generate.ts
CHANGED
@@ -133,9 +133,16 @@ Do not use prefixes such as Response: or Answer: when answering to the user.`,
|
|
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_sim =
|
137 |
console.log("energyUsedwh_sim", energyUsedwh_sim);
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
console.log("energyUsedwh", energyUsedwh);
|
140 |
yield {
|
141 |
type: MessageUpdateType.Metadata,
|
|
|
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_sim = (50 * (durationInSeconds / 3600)).toFixed(6); // Using P = 50W (H100 can use up to 700W)
|
137 |
console.log("energyUsedwh_sim", energyUsedwh_sim);
|
138 |
+
let energyUsedwh = "0";
|
139 |
+
console.log("output", output);
|
140 |
+
if (output.energy_consumption === undefined) {
|
141 |
+
energyUsedwh = (energyUsedwh_sim / 1000).toFixed(6); // converting from mJ to Wh
|
142 |
+
} else {
|
143 |
+
// if the model has energy consumption, we use it instead
|
144 |
+
energyUsedwh = (output.energy_consumption / 1000 / 3600).toFixed(6); // converting from mJ to Wh
|
145 |
+
}
|
146 |
console.log("energyUsedwh", energyUsedwh);
|
147 |
yield {
|
148 |
type: MessageUpdateType.Metadata,
|