mirror of
https://github.com/clearml/clearml
synced 2025-02-01 17:43:43 +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,
|
||
|
}
|
||
|
)
|