Spaces:
Runtime error
Runtime error
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -55,9 +55,15 @@ class AudioEvaluationRequest(BaseEvaluationRequest):
|
|
| 55 |
class evaluate_consumption_example(Tool):
|
| 56 |
name = "evaluate_consumption_example"
|
| 57 |
description = "This is only an example. If a manager wants to know what you are capable of, use it : it will use code carbon to evaluate the CO2 emissions from an example Python code"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
output_type = "string"
|
| 59 |
|
| 60 |
-
def forward(self, code
|
| 61 |
request = AudioEvaluationRequest()
|
| 62 |
logging.info("Chargement des données")
|
| 63 |
dataset = load_dataset(request.dataset_name, streaming=True, token=os.getenv("HF_TOKEN"))
|
|
@@ -126,7 +132,7 @@ class evaluate_consumption(Tool):
|
|
| 126 |
}
|
| 127 |
output_type = "string"
|
| 128 |
|
| 129 |
-
def forward(self, code):
|
| 130 |
|
| 131 |
# Start tracking emissions
|
| 132 |
tracker.start()
|
|
|
|
| 55 |
class evaluate_consumption_example(Tool):
|
| 56 |
name = "evaluate_consumption_example"
|
| 57 |
description = "This is only an example. If a manager wants to know what you are capable of, use it : it will use code carbon to evaluate the CO2 emissions from an example Python code"
|
| 58 |
+
inputs = {
|
| 59 |
+
"code": {
|
| 60 |
+
"type": "string",
|
| 61 |
+
"description": "The code to evaluate. Here, it is an example, so just set it to 'None'.
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
output_type = "string"
|
| 65 |
|
| 66 |
+
def forward(self, code : string):
|
| 67 |
request = AudioEvaluationRequest()
|
| 68 |
logging.info("Chargement des données")
|
| 69 |
dataset = load_dataset(request.dataset_name, streaming=True, token=os.getenv("HF_TOKEN"))
|
|
|
|
| 132 |
}
|
| 133 |
output_type = "string"
|
| 134 |
|
| 135 |
+
def forward(self, code : string):
|
| 136 |
|
| 137 |
# Start tracking emissions
|
| 138 |
tracker.start()
|