Spaces:
Runtime error
Runtime error
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -37,7 +37,6 @@ def preprocess_function(example, feature_extractor):
|
|
| 37 |
)
|
| 38 |
|
| 39 |
def apply_pruning(model, amount=0.3):
|
| 40 |
-
"""Applique un pruning sur les poids du modèle."""
|
| 41 |
for name, module in model.named_modules():
|
| 42 |
if isinstance(module, torch.nn.Linear):
|
| 43 |
prune.l1_unstructured(module, name="weight", amount=amount)
|
|
@@ -123,7 +122,7 @@ class evaluate_consumption_example(Tool):
|
|
| 123 |
|
| 124 |
class evaluate_consumption(Tool):
|
| 125 |
name = "evaluate_consumption"
|
| 126 |
-
description = "
|
| 127 |
inputs = {
|
| 128 |
"code": {
|
| 129 |
"type": "string",
|
|
|
|
| 37 |
)
|
| 38 |
|
| 39 |
def apply_pruning(model, amount=0.3):
|
|
|
|
| 40 |
for name, module in model.named_modules():
|
| 41 |
if isinstance(module, torch.nn.Linear):
|
| 42 |
prune.l1_unstructured(module, name="weight", amount=amount)
|
|
|
|
| 122 |
|
| 123 |
class evaluate_consumption(Tool):
|
| 124 |
name = "evaluate_consumption"
|
| 125 |
+
description = "If the manager gave you its Python code, this function uses code carbon to evaluate the CO2 emissions from the given Python code"
|
| 126 |
inputs = {
|
| 127 |
"code": {
|
| 128 |
"type": "string",
|