Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 2.99 KB

CONTRIBUTING.md

File metadata and controls

80 lines (61 loc) · 2.99 KB

Welcome to opendatahub-tests contributing guide

Thank you for contributing to our project!

New contributor guide

To get an overview of the project, read the README.

Issues

Create a new issue

If you find a problem with the code, search if an issue already exists.
If you open a pull request to fix the problem, an issue will ba automatically created.
If a related issue doesn't exist, you can open a new issue using a relevant issue form.

Pull requests

To contribute code to the project:

  • Fork the project and work on your forked repository
  • Before submitting a new pull request, make sure you have pre-commit package and installed
pre-commit install
  • When submitting a pull request, make sure to fill all the required, relevant fields for your PR.
    Make sure the title is descriptive and short.

General

If you use Visual Studio Code as your IDE, we recommend using the Mypy Type Checker extension. After installing it, make sure to update the Mypy-type-checkers: Args setting to "mypy-type-checker.args" = ["--config-file=pyproject.toml"].

Check the code

Checks tools are used to check the code are defined in .pre-commit-config.yaml file To install pre-commit:

pip install pre-commit --user
pre-commit install
pre-commit install --hook-type commit-msg

Run pre-commit:

pre-commit run --all-files

Adding new runtime

To add a new runtime, you need to:

  1. Add a new file under manifests directory.
  2. Add <runtime>_INFERENCE_CONFIG dict with:
    "support_multi_default_queries": True|False,  # Optioanl, if set to True, `default_query_model` should contains a dict with corresponding inference_type
    "default_query_model": {
        "query_input": <default query to be sent to the model>,
        "query_output": <expected output>,
        "use_regex": True|False, # Optional, if set to True, `query_output` should be a regex
    },
    "<query type, for example: all-tokens>": {
        "<protocol, for example HTTP>": {
            "endpoint": "<model endpoint>",
            "header": "<model required headers>",
            "body": '{<model expected body}',
            "response_fields_map": {
                "response_output": <output field in response>,
                "response": <response field in response - optional>,
            },
        },
  1. Add a new entry to ModelInferenceRuntime
  2. Add the new entry to Mapping
  3. See caikit_standalone for an example