Instructions to use szalontaib/MegaBugInject with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use szalontaib/MegaBugInject with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("/home/bszalontai/balazs_munka/codellama/models_hf/wizard-coder-13b-python") model = PeftModel.from_pretrained(base_model, "szalontaib/MegaBugInject") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -22,7 +22,6 @@ This is a model capable of injecting bugs into correct Python programs. It was u
|
|
| 22 |
You may use the model in the following way:
|
| 23 |
|
| 24 |
```python
|
| 25 |
-
# %%
|
| 26 |
import torch
|
| 27 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 28 |
from peft import PeftModel
|
|
@@ -70,7 +69,10 @@ def bitcount(n):
|
|
| 70 |
|
| 71 |
corrupted_programs = corrupt(
|
| 72 |
test_code, model, tokenizer,
|
| 73 |
-
do_sample=True,
|
|
|
|
|
|
|
|
|
|
| 74 |
)
|
| 75 |
|
| 76 |
for corrupted_program in corrupted_programs:
|
|
|
|
| 22 |
You may use the model in the following way:
|
| 23 |
|
| 24 |
```python
|
|
|
|
| 25 |
import torch
|
| 26 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 27 |
from peft import PeftModel
|
|
|
|
| 69 |
|
| 70 |
corrupted_programs = corrupt(
|
| 71 |
test_code, model, tokenizer,
|
| 72 |
+
do_sample=True,
|
| 73 |
+
temperature=0.5,
|
| 74 |
+
max_new_tokens=4096,
|
| 75 |
+
num_return_sequences=5,
|
| 76 |
)
|
| 77 |
|
| 78 |
for corrupted_program in corrupted_programs:
|