Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Support for downloading on-device models#46

Merged
teelisyys merged 4 commits intomasterfrom
feature/downloading_on_device_models
Sep 26, 2022
Merged

Support for downloading on-device models#46
teelisyys merged 4 commits intomasterfrom
feature/downloading_on_device_models

Conversation

@teelisyys
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@thisismatu thisismatu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teelisyys looks good, but few things needs addressing:

1. When entering an invalid option to the model flag the error message is printed twice along with the help message. One error message should be sufficient without the help message.

> ./bin/speechly download 12345 testi --model asd
Error: "asd" is not a valid option. Available options are: ort, tflite, coreml and all
Usage:
  speechly download [<app_id>] <directory> [flags]

Examples:
speechly download <app_id> /path/to/config
speechly download -a <app_id> .
speechly download -a <app_id> . --model tflite

Flags:
  -a, --app string     Which application's configuration or model to download. Can be given as the first positional argument.
  -h, --help           help for download
      --model string   Specify the machine learning framework model to download. Available options are: ort, tflite, coreml and all. This feature is available on Enterprise plans (https://speechly.com/pricing)

Error executing command: "asd" is not a valid option. Available options are: ort, tflite, coreml and all

2. When entering just some random app_id i get a memory access violation.

> ./bin/speechly download 9dbba3e2-0d75-40db-a45a-a351d6cb8ce7 testi --model=all
Downloading to /Users/matu/Sites/speechly/cli/testi
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x15277d6]

goroutine 1 [running]:
github.com/speechly/cli/cmd.downloadCurrentModel({0x174c268, 0xc0002180f0}, {0xc0000425d0, 0x24}, {0x7ff7bfeffb28, 0x24}, {0x16510b5, 0x3})
	/Users/matu/Sites/speechly/cli/cmd/download.go:177 +0x356
github.com/speechly/cli/cmd.glob..func18(0x1af4660, {0xc000218330, 0x2, 0x3?})
	/Users/matu/Sites/speechly/cli/cmd/download.go:67 +0x287
github.com/spf13/cobra.(*Command).execute(0x1af4660, {0xc000218300, 0x3, 0x3})
	/Users/matu/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1af5ce0)
	/Users/matu/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/matu/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/matu/go/pkg/mod/github.com/spf13/[email protected]/command.go:895
github.com/speechly/cli/cmd.Execute()
	/Users/matu/Sites/speechly/cli/cmd/root.go:41 +0x65
main.main()
	/Users/matu/Sites/speechly/cli/main.go:10 +0x19

@teelisyys
Copy link
Copy Markdown
Contributor Author

@thisismatu

  1. This error+usage+error seems to be consistent across the app for the param validation. I've now removed the second error but kept the usage, as not all error messages currently include the information on what is expected.
  2. This is now fixed.

@teelisyys teelisyys merged commit c62e288 into master Sep 26, 2022
@teelisyys teelisyys deleted the feature/downloading_on_device_models branch September 26, 2022 11:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants