tuntun commited on
Commit
2a74e89
·
1 Parent(s): 98c8761

update comment

Browse files
Files changed (2) hide show
  1. app.py +1 -0
  2. mcp_mlflow_tools.py +5 -7
app.py CHANGED
@@ -57,6 +57,7 @@ def create_interface():
57
  exp_create_button = gr.Button("Create Experiment")
58
 
59
  def create_exp_with_tags(name, tags_str):
 
60
  try:
61
  tags = json.loads(tags_str) if tags_str else None
62
  except json.JSONDecodeError:
 
57
  exp_create_button = gr.Button("Create Experiment")
58
 
59
  def create_exp_with_tags(name, tags_str):
60
+ """Create a new experiment. Given the name and tags"""
61
  try:
62
  tags = json.loads(tags_str) if tags_str else None
63
  except json.JSONDecodeError:
mcp_mlflow_tools.py CHANGED
@@ -43,10 +43,9 @@ def get_system_info() -> Dict:
43
  return {"error": True, "message": f"Failed to fetch system info: {str(e)}"}
44
 
45
  def list_experiments(name_contains: Optional[str] = "", max_results: Optional[int] = 100) -> Dict:
 
 
46
  """
47
- List all experiments in the MLflow tracking server, with optional filtering.
48
- Includes run count for each experiment.
49
-
50
  Args:
51
  name_contains: Optional filter to only include experiments whose names contain this string (case-insensitive).
52
  max_results: Maximum number of results to return (default: 100). None means no limit after filtering.
@@ -141,7 +140,7 @@ def list_experiments(name_contains: Optional[str] = "", max_results: Optional[in
141
  return {"error": True, "message": error_msg}
142
 
143
  def create_experiment(name: str, tags: Optional[Dict[str, str]] = None) -> Dict:
144
- """Create a new experiment."""
145
  if not name:
146
  return {"error": True, "message": "Experiment name cannot be empty"}
147
 
@@ -160,9 +159,9 @@ def search_runs(
160
  order_string: Optional[str] = None,
161
  max_results: int = 100
162
  ) -> Dict:
163
- """
164
- Search runs in a given experiment, with filtering and ordering.
165
 
 
166
  Args:
167
  experiment_id: The ID of the experiment to search runs in.
168
  filter_string: A filter query string used to search for runs.
@@ -320,7 +319,6 @@ def register_model(
320
  ) -> Dict:
321
  """
322
  Register a model from a run, with optional description and tags.
323
- Assumes artifact path is 'model'.
324
  """
325
  if not all([run_id, model_name]):
326
  return {"error": True, "message": "Run ID and model name must be non-empty"}
 
43
  return {"error": True, "message": f"Failed to fetch system info: {str(e)}"}
44
 
45
  def list_experiments(name_contains: Optional[str] = "", max_results: Optional[int] = 100) -> Dict:
46
+ """List all experiments in the MLflow tracking server, with optional filtering. Includes run count for each experiment."""
47
+
48
  """
 
 
 
49
  Args:
50
  name_contains: Optional filter to only include experiments whose names contain this string (case-insensitive).
51
  max_results: Maximum number of results to return (default: 100). None means no limit after filtering.
 
140
  return {"error": True, "message": error_msg}
141
 
142
  def create_experiment(name: str, tags: Optional[Dict[str, str]] = None) -> Dict:
143
+ """Create a new experiment. Given the name and tags"""
144
  if not name:
145
  return {"error": True, "message": "Experiment name cannot be empty"}
146
 
 
159
  order_string: Optional[str] = None,
160
  max_results: int = 100
161
  ) -> Dict:
162
+ """Search runs in a given experiment, with filtering and ordering."""
 
163
 
164
+ """
165
  Args:
166
  experiment_id: The ID of the experiment to search runs in.
167
  filter_string: A filter query string used to search for runs.
 
319
  ) -> Dict:
320
  """
321
  Register a model from a run, with optional description and tags.
 
322
  """
323
  if not all([run_id, model_name]):
324
  return {"error": True, "message": "Run ID and model name must be non-empty"}