docstr: Deletes a model by name
docstr_tok: ["Deletes","a","model","by","name"]
code: def delete(self, project_name, model_name):
      """Deletes a model by name"""
  
      session = SessionController()
  
      project_datanode = session.datahub.get(project_name)
      if project_datanode is None:
          return http_error(
              HTTPStatus.NOT_FOUND,
              "Project not found",
              f"Project name {project_name} does not exist",
          )
  
      name_no_version, version = Predictor.get_name_and_version(
          model_name
      )
      try:
          session.model_controller.get_model(
              name_no_version,
              version=version,
              project_name=project_name,
          )
      except PredictorRecordNotFound:
          return http_error(
              HTTPStatus.NOT_FOUND,
              "Model not found",
              f"Model with name {model_name} not found",
          )
  
      try:
          session.model_controller.delete_model(
              name_no_version, project_name, version=version
          )
      except Exception as e:
          return http_error(
              HTTPStatus.INTERNAL_SERVER_ERROR,
              "Error deleting model",
              f"Something went wrong while deleting {model_name}: {e}",
          )
  
      return "", HTTPStatus.NO_CONTENT
  
imports: from http import HTTPStatus
  import json
  from flask import request
  from flask_restx import Resource
  from sqlalchemy.exc import NoResultFound
  from mindsdb.api.http.namespaces.configs.projects import ns_conf
  from mindsdb.api.http.utils import http_error
  from mindsdb.api.executor.controllers.session_controller import SessionController
  from mindsdb.interfaces.model.functions import PredictorRecordNotFound
  from mindsdb.interfaces.storage.db import Predictor
  from mindsdb_sql import parse_sql
  from mindsdb_sql.parser.dialects.mindsdb import CreatePredictor
label_desc: Use image node_id 3 for calling the ModelResource obj's underlying member method code with example usage: obj.delete(project_name, model_name) and returns: str,  HTTPStatus, http_error, http_error, http_error