Downloads · 30 days
15
21% of all-time downloads
matrixglitch/GRADIO-CODER
GRADIO-CODER is a text generation model from matrixglitch. Use it when you need the model to write or continue text. It is set up for transformers.
This language model is the version 0.0 of a Gradio Coding Assistant. It is an instruction fine-tuned version of StarCoder that is designed to provide assistance to developers who use gradio.
Downloads · 30 days
15
21% of all-time downloads
All-time downloads
72
Public
Repo size
—
Likes
1
Public
Click a slice to open those files.
.json3 MB · 86%
From the Hugging Face model README
This language model is the version 0.0 of a Gradio Coding Assistant. It is an instruction fine-tuned version of StarCoder that is designed to provide assistance to developers who use gradio.
The dataset is multi-source. Its content comes from the following sources
More precisely, we looked into the-stack-dedup which contain codes permissive licenses. We shortlisted the files whose
content incorporated the keyword gradio.
We scrapped all the issues of the official repository the-gradio-app/gradio and added them to our training dataset.
We used the HuggingFace_Hub API to scrape the data from the spaces which are designed with gradio. We kept track of those with permissive licenses, namely MIT and Apache 2.0. This set of code was further deduplicated.
For our fine-tuning, we decided to follow a 2-step strategy.
Our training was done of 8 A100 GPUs of 80GB.
These are the parameters that we used :
LORA PARAMETERS :
We stopped the training before the end and kept the checkpoint-100 for the second step.
This step consisted into the instruction fine-tuning of the previous checkpoint. For that purpose, we used a modified version of openassistant-guanaco.
The template for the instruction fine-tuning was Question: {question}\n\nAnswer: {answer}. We used exactly the same parameters we used during the pretraining and we kept the checkpoint-50.
The usage is straightforward and very similar to any other instruction fine-tuned model.
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint_name="ArmelR/starcoder-gradio-v0"
model = AutoModelForCausalLM.from_pretrained(checkpoint_name)
tokenizer = AutoTokenizer.from_pretrained(checkpoint_name)
prompt = "Create a gradio application that help to convert temperature in celcius into temperature in Fahrenheit"
inputs = tokenizer(f"Question: {prompt}\n\nAnswer: ", return_tensors="pt")
outputs = model.generate(
inputs["input_ids"],
temperature=0.2,
top_p=0.95,
max_new_tokens=200
)
input_len=len(inputs["input_ids"])
print(tokenizer.decode(outputs[0][input_len:]))
Gradio dataset .filter(lambda x : ("gradio" in x["content"] or "gr." in x["content"]) and "streamlit" not in x["content"])
Guanaco ArmelR/oasst1_guanaco
Guanaco multi-turn (HuggingFaceH4/oasst1_en)
For further information, refer to StarCoder.