Class HuggingFaceModel
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.
Inherited Members
Namespace: Oci.GenerativeaiService.Models
Assembly: OCI.DotNetSDK.Generativeai.dll
Syntax
public class HuggingFaceModel : ModelDataSource
Properties
AccessToken
Declaration
[JsonProperty(PropertyName = "accessToken")]
public string AccessToken { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Hugging Face access token to authenticate requests for restricted models. This token will be securely stored in OCI Vault. |
Branch
Declaration
[JsonProperty(PropertyName = "branch")]
public string Branch { get; set; }
Property Value
| Type | Description |
|---|---|
| string | 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. |
Commit
Declaration
[JsonProperty(PropertyName = "commit")]
public string Commit { get; set; }
Property Value
| Type | Description |
|---|---|
| string | 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. |
ModelId
Declaration
[Required(ErrorMessage = "ModelId is required.")]
[JsonProperty(PropertyName = "modelId")]
public string ModelId { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The full model OCID from Hugging Face, typically in the format "org/model-name" (e.g., "meta-llama/Llama-2-7b"). |
Remarks
Required