Update README.md
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ with permissive licenses, namely MIT and Apache 2.0. This set of code was furthe
|
|
| 21 |
For our fine-tuning, we decided to follow a 2-step strategy.
|
| 22 |
- Pretraining (Fine-tuning) with next token prediction on the previously built gradio dataset (this step should familiarize the model with the gradio syntax.).
|
| 23 |
- Instruction fine-tuning on an instruction dataset (this step should make the model conversational.).
|
| 24 |
-
For both steps, we made use of parameter-efficient fine-tuning via the library [PEFT](https://github.com/huggingface/peft), more precisely [
|
| 25 |
training script is the famous [starcoder fine-tuning script](https://github.com/bigcode-project/starcoder).
|
| 26 |
|
| 27 |
## Resources
|
|
@@ -59,8 +59,10 @@ model = AutoModelForCausalLM.from_pretrained(checkpoint_name)
|
|
| 59 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint_name)
|
| 60 |
prompt = "Create a gradio application that help to convert temperature in celcius into temperature in Fahrenheit"
|
| 61 |
inputs = tokenizer(f"Question: {prompt}\n\nAnswer: ", return_tensors="pt")
|
| 62 |
-
outputs = model.generate(inputs["input_ids"], temperature=0.2, top_p=0.95)
|
| 63 |
-
|
|
|
|
| 64 |
```
|
|
|
|
| 65 |
# More information
|
| 66 |
For further information, refer to [StarCoder](https://huggingface.co/bigcode/starcoder).
|
|
|
|
| 21 |
For our fine-tuning, we decided to follow a 2-step strategy.
|
| 22 |
- Pretraining (Fine-tuning) with next token prediction on the previously built gradio dataset (this step should familiarize the model with the gradio syntax.).
|
| 23 |
- Instruction fine-tuning on an instruction dataset (this step should make the model conversational.).
|
| 24 |
+
For both steps, we made use of parameter-efficient fine-tuning via the library [PEFT](https://github.com/huggingface/peft), more precisely [LoRA](https://arxiv.org/abs/2106.09685). Our
|
| 25 |
training script is the famous [starcoder fine-tuning script](https://github.com/bigcode-project/starcoder).
|
| 26 |
|
| 27 |
## Resources
|
|
|
|
| 59 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint_name)
|
| 60 |
prompt = "Create a gradio application that help to convert temperature in celcius into temperature in Fahrenheit"
|
| 61 |
inputs = tokenizer(f"Question: {prompt}\n\nAnswer: ", return_tensors="pt")
|
| 62 |
+
outputs = model.generate(inputs["input_ids"], temperature=0.2, top_p=0.95, max_length=200)
|
| 63 |
+
input_len=len(inputs["input_ids"])
|
| 64 |
+
print(tokenizer.decode(outputs[0][input_len:]))
|
| 65 |
```
|
| 66 |
+
|
| 67 |
# More information
|
| 68 |
For further information, refer to [StarCoder](https://huggingface.co/bigcode/starcoder).
|