Problem description:
As announced in https://twitter.com/amasad/status/1702003510060228786 i should be able to run inference with few lines of code, without API keys and etc, available for free for Pro accounts, with code such as:
from replit.ai.modelfarm import CompletionModel
# Set the path to the trained model
def main():
model = CompletionModel("text-bison")
prompts = ["Hello", "How are you?", "What is your name?"]
for prompt in prompts:
print(prompt)
print(model.complete(prompt))
print()
if __name__ == "__main__":
main()
Expected behavior:
Get completion
Actual behavior:
Traceback (most recent call last):
File "main.py", line 15, in <module>
main()
File "main.py", line 9, in main
print(model.complete(prompt))
File "/home/runner/CloudyFrizzyIdentifier/.pythonlibs/lib/python3.10/site-packages/replit/ai/modelfarm/completion_model.py", line 51, in complete
self._check_response(response)
File "/home/runner/CloudyFrizzyIdentifier/.pythonlibs/lib/python3.10/site-packages/replit/ai/modelfarm/model.py", line 57, in _check_response
raise InvalidResponseException(rjson["detail"])
replit.ai.modelfarm.exceptions.InvalidResponseException: Non-paying account.
Steps to reproduce:
Bug appears at this link:
Browser:
OS: Linux
Device (Android, iOS, n/a leave blank): PC
Plan (Free, Hacker, Pro Plan): Pro
Python version is not done yet.
Use the TS version, or maybe you could try and figure out how to make your own Wrapper.
The module API’s use Env. Vars. and stuff.
Nope, doesnt work for me:
“replit.ai.modelfarm.exceptions.InvalidResponseException: Non-paying account.”
Just rechecked, i have Pro badge (paid year). It’s sad i’m going to lose free days and ticking clock of paid account due bug
Not sure if there is better way to share code/screenshot:
Oh that is awesome! We punted documenting the rest API for this initial release, but it’s on the roadmap. I’ll make sure to prioritize it and let you know when it’s done.
The source code for the python library is open-source, so you can take a look at that if you’d like: GitHub - replit/replit-ai-python: The library for Replit AI. The trickiest piece will be getting the auths, but it should be fairly easy to figure out from the code.