Class HuggingFaceModel


  • @Generated(value="OracleSDKGenerator",
               comments="API Version: 20231130")
    public final class HuggingFaceModel
    extends ModelDataSource
    Configuration for importing a model from Hugging Face.

    Requires the model ID and a reference to the token stored in a vault for authenticated access.
    Note: Objects should always be created or deserialized using the HuggingFaceModel.Builder. This model distinguishes fields that are null because they are unset from fields that are explicitly set to null. This is done in the setter methods of the HuggingFaceModel.Builder, which maintain a set of all explicitly set fields called HuggingFaceModel.Builder.__explicitlySet__. The hashCode() and equals(Object) methods are implemented to take the explicitly set fields into account. The constructor, on the other hand, does not take the explicitly set fields into account (since the constructor cannot distinguish explicit null from unset null).

    • Method Detail

      • getModelId

        public String getModelId()
        The full model OCID from Hugging Face, typically in the format “org/model-name” (e.g., “meta-llama/Llama-2-7b”).
        Returns:
        the value
      • getAccessToken

        public String getAccessToken()
        Hugging Face access token to authenticate requests for restricted models.

        This token will be securely stored in OCI Vault.

        Returns:
        the value
      • getBranch

        public String getBranch()
        The name of the branch in the Hugging Face repository to import the model from.

        If not specified, “main” will be used by default. If you provide both a branch and a commit hash, the model will be imported from the specified commit.

        Returns:
        the value
      • getCommit

        public String getCommit()
        The commit hash in the Hugging Face repository to import the model from.

        If both a branch and a commit are provided, the commit hash will be used.

        Returns:
        the value
      • toString

        public String toString​(boolean includeByteArrayContents)
        Return a string representation of the object.
        Overrides:
        toString in class ModelDataSource
        Parameters:
        includeByteArrayContents - true to include the full contents of byte arrays
        Returns:
        string representation