i´m trying to use Replicate to run some neural networks in the cloud but it yields this error message:
ReplicateError: No API token provided. You need to set the REPLICATE_API_TOKEN environment variable or create a client with `replicate.Client(api_token=...)`.
You can find your API key on https://replicate.com
and python also can´t find it with the command
print(os.environ.get("REPLICATE_API_TOKEN"))
i already tried passing it using sysdm.cpl and it still doesnt work. How do I set it as an environmental variable?
I was facing the same issue when trying to run Llama. Here is my solution:
os.environ["REPLICATE_API_TOKEN"] = "TOKEN"
api = replicate.Client(api_token=os.environ["REPLICATE_API_TOKEN"])
output = api.run(
"meta/llama-2-70b-chat:02e509c789964a7ea8736978a43525956ef40397be9033abf9fd2badfe68c9e3",
input={"prompt": prompt}
)
for item in output:
print(item, end="")
Was also getting an auth issue. This is what worked -
replicate = replicate.Client(api_token='')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With