codeparrot/github-code
Updated โข 36.7k โข 407
Run usvsnsp/code-vs-nl 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:
Use HF Jobs to fine-tune https://huggingface.co/usvsnsp/code-vs-nl. 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.
Use HF Jobs to run batch inference with https://huggingface.co/usvsnsp/code-vs-nl 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.
How to use usvsnsp/code-vs-nl with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="usvsnsp/code-vs-nl") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("usvsnsp/code-vs-nl")
model = AutoModelForSequenceClassification.from_pretrained("usvsnsp/code-vs-nl", device_map="auto")This model is a fine-tuned version of distilbert-base-uncased on bookcorpus for text and codeparrot/github-code for code datasets. It achieves the following results on the evaluation set:
As it's a finetuned model, it's architecture is same as distilbert-base-uncased for Sequence Classification
Can be used to classify documents into text and code
It is a mix of above two datasets, equally random sampled
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Score |
|---|---|---|---|---|---|
| 0.5732 | 0.07 | 500 | 0.5658 | 0.9934 | 0.9934 |
| 0.5254 | 0.14 | 1000 | 0.5180 | 0.9951 | 0.9950 |
Base model
distilbert/distilbert-base-uncased