Skip to content

Commit 86fcc05

Browse files
committed
change model_id format
1 parent 02d8a69 commit 86fcc05

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

docs/resources/inference_custom_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ In addition to all arguments above, the following attributes are exported:
5959
- `description` - A textual description of the model (if available).
6060
- `has_eula` - Whether the model requires end-user license agreement acceptance before use.
6161
- `parameter_size_bits` - Size, in bits, of the model parameters.
62-
- `size_bits` - Total size, in bytes, of the model archive.
62+
- `size_bytes` - Total size, in bytes, of the model archive.
6363
- `nodes_support` - List of supported node types and their quantization options. Each entry contains:
6464
- `node_type_name` - The type of node supported.
6565
- `quantization` - A list of supported quantization options, including:

internal/services/inference/custom_model.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func ResourceCustomModel() *schema.Resource {
124124
Computed: true,
125125
Description: "Size, in bits, of the model parameters",
126126
},
127-
"size_bits": {
127+
"size_bytes": {
128128
Type: schema.TypeInt,
129129
Computed: true,
130130
Description: "Total size, in bytes, of the model files",
@@ -195,7 +195,7 @@ func ResourceCustomModelRead(ctx context.Context, d *schema.ResourceData, m inte
195195
}
196196

197197
_ = d.Set("parameter_size_bits", int32(model.ParameterSizeBits))
198-
_ = d.Set("size_bits", int64(model.SizeBytes))
198+
_ = d.Set("size_bytes", int64(model.SizeBytes))
199199
_ = d.Set("name", model.Name)
200200
_ = d.Set("status", model.Status)
201201
_ = d.Set("description", model.Description)
@@ -219,13 +219,8 @@ func ResourceCustomModelDelete(ctx context.Context, d *schema.ResourceData, m in
219219
return diag.FromErr(err)
220220
}
221221

222-
err = api.DeleteModel(&inference.DeleteModelRequest{
222+
return diag.FromErr(api.DeleteModel(&inference.DeleteModelRequest{
223223
Region: region,
224-
ModelID: id,
225-
}, scw.WithContext(ctx))
226-
if err != nil {
227-
return diag.FromErr(err)
228-
}
229-
230-
return nil
224+
ModelID: d.Id(),
225+
}, scw.WithContext(ctx)))
231226
}

internal/services/inference/custom_model_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ import (
1313
)
1414

1515
const (
16-
modelURLCompatible = "https://huggingface.co/agentica-org/DeepCoder-14B-Preview"
17-
modelURLNotCompatible = "https://huggingface.co/google/gemma-3-4b-it"
18-
nodeTypeH100 = "H100"
16+
modelURLCompatible = "https://huggingface.co/agentica-org/DeepCoder-14B-Preview"
17+
nodeTypeH100 = "H100"
1918
)
2019

2120
func TestAccCustomModel_Basic(t *testing.T) {

0 commit comments

Comments
 (0)