Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize tag detect rule and fix space clone url bug #123

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion builder/git/gitserver/gitaly/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gitaly

import (
"context"
"errors"
"fmt"
"io"
"math"
Expand Down Expand Up @@ -142,7 +143,7 @@ func (c *Client) GetSingleCommit(ctx context.Context, req gitserver.GetRepoLastC
if err != nil {
return nil, err
}
if commitResp != nil {
if commitResp != nil && commitResp.Commit != nil {
commit = types.Commit{
ID: string(commitResp.Commit.Id),
CommitterName: string(commitResp.Commit.Committer.Name),
Expand All @@ -160,6 +161,8 @@ func (c *Client) GetSingleCommit(ctx context.Context, req gitserver.GetRepoLastC
})
}

} else {
return nil, errors.New("commit not found")
}
result = types.CommitResponse{
Commit: &commit,
Expand Down
1 change: 0 additions & 1 deletion cmd/csghub-server/cmd/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
func init() {
Cmd.AddCommand(serverCmd)
Cmd.AddCommand(rproxyCmd)
Cmd.AddCommand(syncServerCmd)
}

var Cmd = &cobra.Command{
Expand Down
49 changes: 0 additions & 49 deletions cmd/csghub-server/cmd/start/syncserver.go

This file was deleted.

4 changes: 2 additions & 2 deletions component/tagparser/nameparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ func LibraryTag(filePath string) string {
}

func isPytorch(filename string) bool {
return strings.HasPrefix(filename, "pytorch_model") && strings.HasSuffix(filename, ".bin")
return (strings.HasPrefix(filename, "pytorch_model") && strings.HasSuffix(filename, ".bin")) || strings.HasSuffix(filename, ".pt")
}

func isTensorflow(filename string) bool {
return strings.HasPrefix(filename, "tf_model") && strings.HasSuffix(filename, ".h5")
}
func isSafetensors(filename string) bool {
return strings.HasPrefix(filename, "model") && strings.HasSuffix(filename, ".safetensors")
return strings.HasSuffix(filename, ".safetensors")
}
func isJAX(filename string) bool {
return strings.HasPrefix(filename, "flax_model") && strings.HasSuffix(filename, ".msgpack")
Expand Down
6 changes: 4 additions & 2 deletions component/tagparser/nameparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestLibraryTag(t *testing.T) {
{name: "case insensitive", args: args{filePath: "Pytorch_model.Bin"}, want: "pytorch"},

{name: "pytorch", args: args{filePath: "pytorch_model.bin"}, want: "pytorch"},
{name: "pytorch", args: args{filePath: "model.pt"}, want: "pytorch"},
{name: "pytorch", args: args{filePath: "pytorch_model_001.bin"}, want: "pytorch"},
{name: "not pytorch", args: args{filePath: "1-pytorch_model_001.bin"}, want: ""},
{name: "not pytorch", args: args{filePath: "pytorch_model-bin"}, want: ""},
Expand All @@ -25,8 +26,9 @@ func TestLibraryTag(t *testing.T) {

{name: "safetensors", args: args{filePath: "model.safetensors"}, want: "safetensors"},
{name: "safetensors", args: args{filePath: "model_001.safetensors"}, want: "safetensors"},
{name: "not safetensors", args: args{filePath: "1-model.safetensors"}, want: ""},
{name: "not safetensors", args: args{filePath: "model-safetensors"}, want: ""},
{name: "safetensors", args: args{filePath: "adpter_model.safetensors"}, want: "safetensors"},
{name: "not safetensors", args: args{filePath: "1-test.safeten"}, want: ""},
{name: "not safetensors", args: args{filePath: "test-safetensors"}, want: ""},

{name: "flax_model", args: args{filePath: "flax_model.msgpack"}, want: "jax"},
{name: "flax_model", args: args{filePath: "flax_model-001.msgpack"}, want: "jax"},
Expand Down
53 changes: 0 additions & 53 deletions multisync/accounting/aync_quota_statement.go

This file was deleted.

135 changes: 0 additions & 135 deletions multisync/accounting/client.go

This file was deleted.

52 changes: 0 additions & 52 deletions multisync/accounting/sync_quota.go

This file was deleted.

Loading