Coder Social home page Coder Social logo

cli's People

Contributors

dependabot[bot] avatar jakedahn avatar lilic avatar mattt avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Impossible to pass "false" as training input value

When I try to set crop_based_on_salience to false, I try:

replicate train stability-ai/sdxl [email protected] resolution=128 crop_based_on_salience=false caption_prefix="pixelart sprites in the style of TOK, " --destination=andreasjansson/sdxl-pixelart-sprites 
Training created: https://replicate.com/p/7tyxhvtboyeblkprtiulb6aeqm

The training doesn't actually include the crop_based_on_salience argument
image

`replicate train` requires inputs to be zip files

Training Llama 13B fails with the following error:

replicate train a16z-infra/llama-2-13b-chat train_data="@/Users/andreas/Downloads/massive_abcnotation_dataset.pruned.jsonl" --destination=andreasjansson/abc-llama

Error: failed to parse inputs: failed to upload file: file is not a zip file
Usage:
  replicate train <owner/model[:version]> [input=value] ... [flags]

Flags:
  -d, --destination string   Destination model for training
  -h, --help                 help for train
      --json                 Emit JSON
  -s, --separator string     Separator between input key and value (default "=")
      --web                  View on web

failed to create model: Replicate API error: Unknown error: json: cannot unmarshal object into Go struct field APIError.detail of type string

I get the following error when trying to create a model via the CLI tool. Any idea what could be the issue here? I have set the API Key correctly and replicate model show <owner-redacted>/<name> works:

ยป replicate model create <owner-redacted>/<name-redacted>  --private --hardware gpu-a40-large
Error: failed to create model: failed to create model: Replicate API error: Unknown error: json: cannot unmarshal object into Go struct field APIError.detail of type string
Usage:
  replicate model create <owner>/<name> [flags]

Flags:
      --cover-image-url string   URL of the cover image
      --description string       Description of the model
      --github-url string        URL of the GitHub repository
      --hardware string          SKU of the hardware to run the model
  -h, --help                     help for create
      --json                     Emit JSON
      --license-url string       URL of the license
      --paper-url string         URL of the paper
      --private                  Make the new model private
      --public                   Make the new model public
      --web                      View on web

Build cli release binaries for linux

It would be cool if we had release binaries for Linux. At the moment, we only have a streamlined solution for installing the Replicate CLI on MacOS with Homebrew.

brew tap replicate/tap
brew install replicate

If you are on LInux, the only way to install the CLI is to clone the code, install the right version of golang, and build the binary yourself -- which would be a deal breaker for me if I were a Linux user.

Login flow of `auth login` using `REPLICATE_API_TOKEN`

AFAIK, there is no other method available aside from passing the token via stdin like following.

echo $REPLICATE_API_TOKEN | replicate auth login --token-stdin

I'm curious about why the token isn't an argument of the login command. Are there any other factors besides security considerations like exposing it in logs?

Alternatively, CLI could access $REPLICATE_API_TOKEN environment variable and extract the token automatically without requiring any explicit argument. This approach provides a more secure and seamless authentication process for users.

`replicate model show` segfaults if the model has no versions

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x86a3b6]

goroutine 1 [running]:
github.com/replicate/cli/internal/cmd/model.init.func4(0xd8f940, {0xc000192150, 0x4?, 0x94b1d4?})
	/tmp/cli-0.7.1/internal/cmd/model/show.go:77 +0x4d6
github.com/spf13/cobra.(*Command).execute(0xd8f940, {0xc000192120, 0x1, 0x1})
	/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xd8c860)
	/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/replicate/cli/cmd/replicate.Execute()
	/tmp/cli-0.7.1/cmd/replicate/main.go:27 +0x1a
main.main()
	/tmp/cli-0.7.1/main.go:6 +0xf

Confusing error message when testing scaffolded project

Currently when generating the scaffolded project it just prints the stdout of the subprocess directly. This makes it look like the scaffold has failed rather than just the test. It took me a while to work out:

Output
replicate scaffold 3p2twllb5nsudqmtakaygg4dz4 --template=node
Cloning starter repo and installing dependencies...
Cloning into '3p2twllb5nsudqmtakaygg4dz4'...
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 22 (delta 10), reused 8 (delta 2), pack-reused 0
Receiving objects: 100% (22/22), 4.32 KiB | 4.32 MiB/s, done.
Resolving deltas: 100% (10/10), done.

added 2 packages in 1s
npm notice 
npm notice New major version of npm available! 9.8.1 -> 10.2.4
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.4
npm notice Run npm install -g [email protected] to update!
npm notice 
Writing new index.js...
Running example prediction...
Uh oh, an error occurred.
ApiError: Request to https://api.replicate.com/v1/predictions failed with status 402 Payment Required: {"title":"Monthly spend limit reached","detail":"You've hit your monthly spend limit. You can change or remove your limit at https://replicate.com/account/billing#limits.","status":402}
.
    at Replicate.request (/Users/Aron/Code/sandbox/3p2twllb5nsudqmtakaygg4dz4/node_modules/replicate/index.js:229:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Replicate.createPrediction (/Users/Aron/Code/sandbox/3p2twllb5nsudqmtakaygg4dz4/node_modules/replicate/lib/predictions.js:24:20)
    at async Replicate.run (/Users/Aron/Code/sandbox/3p2twllb5nsudqmtakaygg4dz4/node_modules/replicate/index.js:126:22)
    at async main (file:///Users/Aron/Code/sandbox/3p2twllb5nsudqmtakaygg4dz4/index.js:17:18) {
  request: Request {
    [Symbol(realm)]: { settingsObject: [Object] },
    [Symbol(state)]: {
      method: 'POST',
      localURLsOnly: false,
      unsafeRequest: false,
      body: [Object],
      client: [Object],
      reservedClient: null,
      replacesClientId: '',
      window: 'client',
      keepalive: false,
      serviceWorkers: 'all',
      initiator: '',
      destination: '',
      priority: null,
      origin: 'client',
      policyContainer: 'client',
      referrer: 'client',
      referrerPolicy: '',
      mode: 'cors',
      useCORSPreflightFlag: false,
      credentials: 'same-origin',
      useCredentials: false,
      cache: 'default',
      redirect: 'follow',
      integrity: '',
      cryptoGraphicsNonceMetadata: '',
      parserMetadata: '',
      reloadNavigation: false,
      historyNavigation: false,
      userActivation: false,
      taintedOrigin: false,
      redirectCount: 0,
      responseTainting: 'basic',
      preventNoCacheCacheControlHeaderModification: false,
      done: false,
      timingAllowFailed: false,
      headersList: [HeadersList],
      urlList: [Array],
      url: URL {}
    },
    [Symbol(signal)]: AbortSignal { aborted: false },
    [Symbol(headers)]: HeadersList {
      cookies: null,
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  },
  response: Response {
    [Symbol(realm)]: null,
    [Symbol(state)]: {
      aborted: false,
      rangeRequested: false,
      timingAllowPassed: true,
      requestIncludesCredentials: true,
      type: 'default',
      status: 402,
      timingInfo: [Object],
      cacheState: '',
      statusText: 'Payment Required',
      headersList: [HeadersList],
      urlList: [Array],
      body: [Object]
    },
    [Symbol(headers)]: HeadersList {
      cookies: null,
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
}

I think a simple place to start would be to have some form of delimiters.

--- START OF OUTPUT ---
...
--- END OF OUTPUT ---

But it might also be worth cleaning up the error messages of the template to make it more friendly too. If this sounds good ๐Ÿ‘ and I'll implement it.

Unable to run `show` or `scaffold` for predictions I don't own

TLDR

replicate show and replicate scaffold works for predictions owned by my token, but not for any other predictions, even if they're shared.

I'm not sure if this is a regression, or if it has never worked for non-owners.

Long story

I tried running the scaffold example in the README

I can see that prediction on the web, even in an incognito window: https://replicate.com/p/jpgp263bdekvxileu2ppsy46v4

But when I tried to scaffold from it, I get an error:

$ replicate scaffold https://replicate.com/p/jpgp263bdekvxileu2ppsy46v4 --template=node
Error: failed to get prediction: failed to get prediction: The requested resource could not be found.

Sometimes zsh is a bit finicky about unquoted strings, so I tried quoting the URL:

replicate scaffold "https://replicate.com/p/jpgp263bdekvxileu2ppsy46v4" --template=node
Error: failed to get prediction: failed to get prediction: The requested resource could not be found.

Then I tried just the prediction id, but still no joy:

$ replicate scaffold jpgp263bdekvxileu2ppsy46v4 --template=node  
Error: failed to get prediction: failed to get prediction: The requested resource could not be found.

My own prediction works

So then I thought.. maybe I'm not authenticated?

But I can run the scaffold command for my own predictions, created with my zeke account on Replicate:

$ replicate scaffold 7khq4kzbhoogsnjgcujur7hhgi
Cloning starter repo and installing dependencies...
Cloning into '7khq4kzbhoogsnjgcujur7hhgi'...
...
Done!

A new shared prediction that I don't own doesn't work

Next I created a prediction from one of my orgs (replicate), then shared it: https://replicate.com/p/elqle2bbcval7o53g7w5wpub4u

But using the CLI with my personal token (not the org token), it fails:

$ replicate prediction show elqle2bbcval7o53g7w5wpub4u
Error: failed to get prediction: failed to get prediction: The requested resource could not be found.
$ replicate scaffold elqle2bbcval7o53g7w5wpub4u                            
Error: failed to get prediction: failed to get prediction: The requested resource could not be found.

Version

$ replicate --version
replicate version 0.7.0

cc @replicate/product @replicate/hackers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.