Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
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
6 changes: 5 additions & 1 deletion cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ var uploadCmd = &cobra.Command{
if inFile == "" {
log.Fatalf("No file given for uploading")
}
contentTypeInt, _ := cmd.Flags().GetInt("content_type")
contentType := configv1.UploadTrainingDataRequest_ContentType(contentTypeInt)

reader, err := os.Open(inFile)
if err != nil {
log.Fatalf("Could not open file: %s: %s", inFile, err)
Expand All @@ -40,7 +43,7 @@ var uploadCmd = &cobra.Command{
log.Fatalf("Could not read file %s: %s", inFile, err)
}
total += n
req := &configv1.UploadTrainingDataRequest{AppId: appId, DataChunk: buffer[:n]}
req := &configv1.UploadTrainingDataRequest{AppId: appId, DataChunk: buffer[:n], ContentType: contentType}
if err = stream.Send(req); err != nil {
log.Fatalf("Uploading training data failed: %s", err)
}
Expand All @@ -57,4 +60,5 @@ var uploadCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(uploadCmd)
uploadCmd.Flags().StringP("file", "f", "", "File to upload. Will start training.")
uploadCmd.Flags().Int("content_type", 0, "Content type of the training data. 1 for .yaml, 2 for .tar.")
}
Binary file modified config.protoset
Binary file not shown.
Loading