Run this model with HF Jobs
Run codesage/codesage-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/codesage/codesage-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/codesage/codesage-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use codesage/codesage-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codesage/codesage-base with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import CodeSage model = CodeSage.from_pretrained("codesage/codesage-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add Sentence Transformers support
#3
by tomaarsen HF Staff - opened
Hello!
Pull Request overview
- Add Sentence Transformers support.
Details
With this PR, it will become possible to load this model with Sentence Transformers without triggering any warnings. The embeddings match that of the transformers approach, but the Sentence Transformers project simplifies some of the steps for the end user (e.g. no need to worry about tokenization, output shapes, etc.).
If you want to experiment with this PR before merging it, then you can use the revision option like so:
from sentence_transformers import SentenceTransformer
checkpoint = r"codesage/codesage-base"
device = "cuda" # for GPU usage or "cpu" for CPU usage
revision = "refs/pr/3"
model = SentenceTransformer(checkpoint, device=device, trust_remote_code=True, revision=revision)
embedding = model.encode("def print_hello_world():\tprint('Hello World!')")
print(f'Dimension of the embedding: {embedding.size}')
# print(f'Dimension of the embedding: 1024')
after doing
pip install -U sentence-transformers
- Tom Aarsen
tomaarsen changed pull request status to open