Instructions to use sagard21/python-code-explainer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sagard21/python-code-explainer with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "summarization" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("summarization", model="sagard21/python-code-explainer")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("sagard21/python-code-explainer") model = AutoModelForSeq2SeqLM.from_pretrained("sagard21/python-code-explainer") - Notebooks
- Google Colab
- Kaggle
How to custom train
Hi folks,
Do anybody know, how can we custom train this model on other languages ?
Thanks,
@tusharpiku I have used salesforce T5 as the base model. It works on 6 languages as far as I remember. But you can create a dataset for your own language and fine-tune this model. The dataset I used for fine-tuning is private, however, I can share it with you.
Here is the link - https://huggingface.co/datasets/sagard21/autotrain-data-code-explainer
Hi @sagard21 , the dataset link isn't working. I'd like to train one on Java/Spring boot to be precise. Would it be possible for you to fix the link so that I can try creating my own dataset?
Hi @marmikpandya and @Nik18 I have made the dataset public so that it can benefit all. The link still stays the same - sagard21/autotrain-data-code-explainer
Hope this dataset is accessible to you guys. If not, then you can create a new discussion. Closing this for now.