Documentation ¶
Overview ¶
Copyright 2024 KubeAGI.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 KubeAGI.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 KubeAGI.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 KubeAGI.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 KubeAGI.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- type BranchTag
- type EachRevision
- type Forward
- type HuggingFace
- func (h *HuggingFace) DownloadFile(ctx context.Context, opts ...Option) ([]byte, error)
- func (h *HuggingFace) Files(ctx context.Context, opts ...Option) ([]string, error)
- func (h *HuggingFace) Revisions(ctx context.Context, opts ...Option) (Revision, error)
- func (h *HuggingFace) Summary(ctx context.Context, opts ...Option) (string, error)
- type Model
- type ModelRevision
- type ModelScope
- func (m *ModelScope) DownloadFile(ctx context.Context, opts ...Option) ([]byte, error)
- func (m *ModelScope) Files(ctx context.Context, opts ...Option) ([]string, error)
- func (m *ModelScope) Revisions(ctx context.Context, opts ...Option) (Revision, error)
- func (m *ModelScope) Summary(ctx context.Context, opts ...Option) (string, error)
- type ModelScopeRevision
- type ModelScopeRevisionData
- type ModelScopeSummary
- type ModelScopeSummaryData
- type ModelTagBranch
- type Option
- type Revision
- type RevisionMap
- type Sibling
Constants ¶
const ( HuggingFaceForward = "huggingface" ModelScopeForward = "modelscope" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EachRevision ¶
type EachRevision struct {
Revision string `json:"Revision"`
}
type Forward ¶
type Forward interface { Summary(context.Context, ...Option) (string, error) Files(context.Context, ...Option) ([]string, error) Revisions(context.Context, ...Option) (Revision, error) DownloadFile(context.Context, ...Option) ([]byte, error) }
func NewHuggingFace ¶
func NewModelScope ¶
type HuggingFace ¶
type HuggingFace struct {
// contains filtered or unexported fields
}
func (*HuggingFace) DownloadFile ¶
type ModelRevision ¶
type ModelRevision struct { Tags []ModelTagBranch `json:"tags"` Branches []ModelTagBranch `json:"branches"` }
type ModelScope ¶
type ModelScope struct {
// contains filtered or unexported fields
}
func (*ModelScope) DownloadFile ¶
TODO: don't support
type ModelScopeRevision ¶
type ModelScopeRevision struct { Code int `json:"Code"` Data ModelScopeRevisionData `json:"Data"` Message string `json:"Message"` Success bool `json:"Success"` }
type ModelScopeRevisionData ¶
type ModelScopeRevisionData struct {
RevisionMap RevisionMap `json:"RevisionMap"`
}
type ModelScopeSummary ¶
type ModelScopeSummary struct { Code int `json:"Code"` Data ModelScopeSummaryData `json:"Data"` Message string `json:"Message"` Success bool `json:"Success"` }
type ModelScopeSummaryData ¶
type ModelTagBranch ¶
type Option ¶
type Option func(*option)
func WithBaseURL ¶
func WithDownloadFile ¶
func WithHFToken ¶
func WithModelID ¶
func WithRevision ¶
func WithTransport ¶
type RevisionMap ¶
type RevisionMap struct { Branches []EachRevision `json:"Branches"` Tags []EachRevision `json:"Tags"` }