mirror of
https://github.com/clearml/clearml
synced 2025-01-31 17:17:00 +00:00
24 lines
400 B
Python
24 lines
400 B
Python
# ClearML - Example of Python Fire integration, with commands derived from a dictionary
|
|
#
|
|
from clearml import Task
|
|
|
|
import fire
|
|
|
|
|
|
def add(x, y):
|
|
return x + y
|
|
|
|
|
|
def multiply(x, y):
|
|
return x * y
|
|
|
|
|
|
if __name__ == "__main__":
|
|
Task.init(project_name="examples", task_name="Fire dict command")
|
|
fire.Fire(
|
|
{
|
|
"add": add,
|
|
"multiply": multiply,
|
|
}
|
|
)
|