Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 2.46 KB

File metadata and controls

87 lines (57 loc) · 2.46 KB

cms_client.MetadataApi

All URIs are relative to http://localhost

Method HTTP request Description
get_model_card GET /info Get Model Card

get_model_card

ModelCard get_model_card()

Get Model Card

Get information about the model being served

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Api Key Authentication (APIKeyCookie):
import cms_client
from cms_client.models.model_card import ModelCard
from cms_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = cms_client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure API key authorization: APIKeyCookie
configuration.api_key['APIKeyCookie'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyCookie'] = 'Bearer'

# Enter a context with an instance of the API client
with cms_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cms_client.MetadataApi(api_client)

    try:
        # Get Model Card
        api_response = api_instance.get_model_card()
        print("The response of MetadataApi->get_model_card:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MetadataApi->get_model_card: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ModelCard

Authorization

OAuth2PasswordBearer, APIKeyCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]