Instructions to use Salesforce/codet5-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salesforce/codet5-small with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Salesforce/codet5-small") model = AutoModelForSeq2SeqLM.from_pretrained("Salesforce/codet5-small") - Notebooks
- Google Colab
- Kaggle
Code cloning usage
Hello, I am interested in using your Codet5 model for code similarity tasks. I have a question about how to use it in test mode when I have only two code snippets to compare.
According to the CodexGlue dataset format, you expect a list of codes and you return the top n most similar examples to a given query. But what if I want to check the similarity between two specific code snippets? How can I use your model for that?
Can you please provide a way to get a similarity score (maybe a probability) or a binary output (0 or 1) if two code snippets are similar or different? For example, given these two code snippets:
public int f() { return 0;}
public void f() { int i = 0; }
Can your model tell me how similar they are, or if they are equivalent or not?
Thank you for your help and your great work!