Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom specified models for HF model parsers #863

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Support custom specified models for HF model parsers #863

merged 1 commit into from
Jan 10, 2024

Commits on Jan 10, 2024

  1. Support custom specified models for HF model parsers

    The HF prompt schema has been updated in #850 to support a "model" property, which can specify the model to use for a given HF task.
    
    This change updates the model parsers to use this setting.
    
    Test Plan:
    
    Tested with the following prompt:
    ```
        {
          "name": "image_caption",
          "input": {
            "attachments": [
              {
                "data": "https://s3.amazonaws.com/lastmileai.aiconfig.public/uploads/2024_1_10_18_41_31/1742/bear_with_honey.png",
                "mime_type": "image/png"
              },
              {
                "data": "https://s3.amazonaws.com/lastmileai.aiconfig.public/uploads/2024_1_10_18_41_31/7275/fox_in_forest.png",
                "mime_type": "image/png"
              }
            ]
          },
          "metadata": {
            "model": {
              "name": "HuggingFaceImage2TextTransformer",
              "settings": {
                "max_new_tokens": 10,
                "model": "Salesforce/blip-image-captioning-base"
              }
            },
            "parameters": {}
          },
          "outputs": [
            {
              "output_type": "execute_result",
              "execution_count": 0,
              "data": "a bear sitting on a rock eating honey",
              "metadata": {}
            },
            {
              "output_type": "execute_result",
              "execution_count": 1,
              "data": "a red fox in the woods",
              "metadata": {}
            }
          ]
        },
    ```
    
    Validated the the model setting was respected and worked.
    lastmileai-dev committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    5e533b0 View commit details
    Browse the repository at this point in the history