Skip to content

Commit

Permalink
patched extended model location
Browse files Browse the repository at this point in the history
  • Loading branch information
awitas committed Oct 6, 2022
1 parent 9238f75 commit aad6ba1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 15 deletions.
12 changes: 12 additions & 0 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/google/uuid"
tf "github.com/tensorflow/tensorflow/tensorflow/go"
"github.com/viant/afs"
"github.com/viant/afs/url"
"github.com/viant/gmetric"
"github.com/viant/gtly"
"github.com/viant/mly/service/config"
Expand Down Expand Up @@ -270,6 +271,17 @@ func (s *Service) modifiedSnapshot(ctx context.Context, URL string, resource *co
if err != nil {
return resource, err
}
if extURL := url.SchemeExtensionURL(URL); extURL != "" {
object, err := s.fs.Object(ctx, extURL)
if err != nil {
return nil, err
}
resource, err = s.modifiedSnapshot(ctx, extURL, resource)
resource.Max = object.ModTime()
resource.Min = object.ModTime()
return resource, nil
}

for i, item := range objects {
if item.IsDir() && i == 0 {
continue
Expand Down
18 changes: 15 additions & 3 deletions shared/common/storable/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (

//Slice represents slice registry
type Slice struct {
hash int
Values []interface{}
Fields []*Field
hash int
batchSize int
Values []interface{}
Fields []*Field
}

//SetHash sets hash
Expand All @@ -27,6 +28,16 @@ func (s *Slice) Hash() int {
return s.hash
}

//SetHash sets hash
func (s *Slice) SetBatchSize(size int) {
s.batchSize = size
}

//Hash returns hash
func (s *Slice) BatchSize() int {
return s.batchSize
}

//Set sets value
func (s *Slice) Set(iter common.Iterator) error {
s.Values = make([]interface{}, len(s.Fields))
Expand Down Expand Up @@ -128,6 +139,7 @@ func (s *Slice) MarshalJSONObject(enc *gojay.Encoder) {
func (s *Slice) IsNil() bool {
return s == nil
}

//UnmarshalJSONObject unmarshal json with gojay parser
func (s *Slice) UnmarshalJSONObject(dec *gojay.Decoder, key string) error {
s.Values = make([]interface{}, len(s.Fields))
Expand Down
4 changes: 2 additions & 2 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

```bash
git clone https://github.com/viant/mly.git
cd mly/tools/mlytool
cd mly/tools/mly
go build
cp mlytool /usr/local/bin
```

### Usage

```bash
mlytool -h
mly -h
```

##### Exporting layers
Expand Down
11 changes: 11 additions & 0 deletions tools/mly/mly.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"github.com/viant/mly/tools"
"os"
)

func main() {
os.Args = []string{"", "-m=run", "-c=/Users/awitas/go/src/github.vianttech.com/adelphic/mly/kpi/vcr/config.yaml"}
tools.Run(os.Args[1:])
}
10 changes: 0 additions & 10 deletions tools/mlytool/mlytool.go

This file was deleted.

0 comments on commit aad6ba1

Please sign in to comment.