Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pure local mode #20

Merged
merged 3 commits into from
May 12, 2023
Merged

Add pure local mode #20

merged 3 commits into from
May 12, 2023

Conversation

bluecoconut
Copy link
Contributor

Pure local mode lets you use sketch without sending any of your data over the network

Do this by setting 3 environment variables

  1. os.environ['SKETCH_USE_REMOTE_LAMBDAPROMPT'] = 'False' (this turns off talking to us)
  2. os.environ['LAMBDAPROMPT_BACKEND'] = 'StarCoder' (this sets StarCoder model as your backend (rather than relying on OpenAI) (if you want to be sure its set, check lambdaprompt.backends.backends and you can call lambdaprompt.backends.set_backend('StarCoder')
  • os.environ['HF_ACCESS_TOKEN'] = 'your_hugging_face_token' (This is necessary for pulling star-coder, which has an OpenRAIL license --> IF you use MPT as your backend, you will not need the HF_ACCESS_TOKEN)

Notes!

The first install is pretty slow (downloading full weights). I timed it at ~9 minutes

Second runs (eg in a fresh kernel, where the weights are downloaded) still take ~2 minutes for the first request.

But after, that, requests are pretty quick (on an A100 80GB) (and it should work on an A100 40 GB)

I think overall, the more I've been testing, I think StarCoder is actually weaker than OpenAI davinci, but it definitely still works

Here are some screenshots

image (note it took 1.8s to complete this one) image (Note, this HTML list + description took 7.4 seconds) image

(when outputting a lot of code, grows to ~13 seconds)

Overall, these outputs are reasonable but I think when i pay close attention, they're not as good as GPT3 answers. But for a purely open, entirely local model, seems pretty great!

@bluecoconut bluecoconut merged commit 5f79d21 into main May 12, 2023
5 checks passed
@bluecoconut bluecoconut deleted the add-pure-local-mode branch May 12, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant