Spaces:
Runtime error
Runtime error
Update retriever.py
Browse files- retriever.py +8 -2
retriever.py
CHANGED
|
@@ -3,9 +3,15 @@ from smolagents import Tool
|
|
| 3 |
class FrugalAI_methods(Tool):
|
| 4 |
name = "FrugalAI_methods"
|
| 5 |
description = "Retrieves methods for model frugalization."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
output_type = "string"
|
| 7 |
|
| 8 |
-
def pruning(self):
|
| 9 |
"""
|
| 10 |
Optimizes models by removing unnecessary components, such as certain weights in a neural network.
|
| 11 |
This function demonstrates how to apply pruning.
|
|
@@ -18,7 +24,7 @@ class FrugalAI_methods(Tool):
|
|
| 18 |
f"can be increased or decreased depending on the initial number of weights and the complexity of your use case (minimu value: 0, maximum value: 1)."
|
| 19 |
)
|
| 20 |
|
| 21 |
-
def quantization(self):
|
| 22 |
"""
|
| 23 |
Converts high-precision weights into lower-precision one to reduce cost.
|
| 24 |
"""
|
|
|
|
| 3 |
class FrugalAI_methods(Tool):
|
| 4 |
name = "FrugalAI_methods"
|
| 5 |
description = "Retrieves methods for model frugalization."
|
| 6 |
+
inputs = {
|
| 7 |
+
"method": {
|
| 8 |
+
"type": "string",
|
| 9 |
+
"description": "Always set it to 'Frugal' or it will raise an error."
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
output_type = "string"
|
| 13 |
|
| 14 |
+
def pruning(self,method: str):
|
| 15 |
"""
|
| 16 |
Optimizes models by removing unnecessary components, such as certain weights in a neural network.
|
| 17 |
This function demonstrates how to apply pruning.
|
|
|
|
| 24 |
f"can be increased or decreased depending on the initial number of weights and the complexity of your use case (minimu value: 0, maximum value: 1)."
|
| 25 |
)
|
| 26 |
|
| 27 |
+
def quantization(self, method: str):
|
| 28 |
"""
|
| 29 |
Converts high-precision weights into lower-precision one to reduce cost.
|
| 30 |
"""
|