Class HuggingFaceModel
- java.lang.Object
-
- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
- com.oracle.bmc.generativeai.model.ModelDataSource
-
- com.oracle.bmc.generativeai.model.HuggingFaceModel
-
@Generated(value="OracleSDKGenerator", comments="API Version: 20231130") public final class HuggingFaceModel extends ModelDataSourceConfiguration 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 theHuggingFaceModel.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 theHuggingFaceModel.Builder, which maintain a set of all explicitly set fields calledHuggingFaceModel.Builder.__explicitlySet__. ThehashCode()andequals(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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHuggingFaceModel.Builder-
Nested classes/interfaces inherited from class com.oracle.bmc.generativeai.model.ModelDataSource
ModelDataSource.SourceType
-
-
Constructor Summary
Constructors Constructor Description HuggingFaceModel(String modelId, String accessToken, String branch, String commit)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HuggingFaceModel.Builderbuilder()Create a new builder.booleanequals(Object o)StringgetAccessToken()Hugging Face access token to authenticate requests for restricted models.StringgetBranch()The name of the branch in the Hugging Face repository to import the model from.StringgetCommit()The commit hash in the Hugging Face repository to import the model from.StringgetModelId()The full model OCID from Hugging Face, typically in the format “org/model-name” (e.g., “meta-llama/Llama-2-7b”).inthashCode()HuggingFaceModel.BuildertoBuilder()StringtoString()StringtoString(boolean includeByteArrayContents)Return a string representation of the object.
-
-
-
Constructor Detail
-
HuggingFaceModel
@Deprecated public HuggingFaceModel(String modelId, String accessToken, String branch, String commit)
Deprecated.
-
-
Method Detail
-
builder
public static HuggingFaceModel.Builder builder()
Create a new builder.
-
toBuilder
public HuggingFaceModel.Builder toBuilder()
-
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()
- Overrides:
toStringin classModelDataSource
-
toString
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.- Overrides:
toStringin classModelDataSource- Parameters:
includeByteArrayContents- true to include the full contents of byte arrays- Returns:
- string representation
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classModelDataSource
-
hashCode
public int hashCode()
- Overrides:
hashCodein classModelDataSource
-
-