Instructions to use nisten/bigdoc-c34b-python-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nisten/bigdoc-c34b-python-v1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TheBloke/CodeLlama-34B-Instruct-fp16") model = PeftModel.from_pretrained(base_model, "nisten/bigdoc-c34b-python-v1") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
| 2 |
library_name: peft
|
| 3 |
license: mit
|
| 4 |
---
|
| 5 |
-
##
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
The following `bitsandbytes` quantization config was used during training:
|
|
@@ -37,14 +38,14 @@ import torch
|
|
| 37 |
from peft import PeftModel
|
| 38 |
from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaTokenizer, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer
|
| 39 |
|
| 40 |
-
model_name = "TheBloke/CodeLlama-34B-
|
| 41 |
adapters_name = 'nisten/bigdoc-c34b-python-v1'
|
| 42 |
|
| 43 |
print(f"Starting to load the model {model_name} into memory")
|
| 44 |
|
| 45 |
m = AutoModelForCausalLM.from_pretrained(
|
| 46 |
model_name,
|
| 47 |
-
load_in_4bit=True, #19GB in 4bit, 38GB with load_in_8bit, 67GB in full f16 if you just delete this line
|
| 48 |
torch_dtype=torch.bfloat16,
|
| 49 |
device_map={"": 0}
|
| 50 |
)
|
|
@@ -62,12 +63,11 @@ print(f"Successfully loaded the model {model_name} into memory")
|
|
| 62 |
|
| 63 |
```
|
| 64 |
|
| 65 |
-
###
|
| 66 |
|
| 67 |
```
|
| 68 |
|
| 69 |
-
#
|
| 70 |
-
|
| 71 |
import datetime
|
| 72 |
import os
|
| 73 |
from threading import Event, Thread
|
|
|
|
| 2 |
library_name: peft
|
| 3 |
license: mit
|
| 4 |
---
|
| 5 |
+
## training only 2000/5000 complete
|
| 6 |
+
|
| 7 |
|
| 8 |
|
| 9 |
The following `bitsandbytes` quantization config was used during training:
|
|
|
|
| 38 |
from peft import PeftModel
|
| 39 |
from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaTokenizer, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer
|
| 40 |
|
| 41 |
+
model_name = "TheBloke/CodeLlama-34B-Instruct-fp16"
|
| 42 |
adapters_name = 'nisten/bigdoc-c34b-python-v1'
|
| 43 |
|
| 44 |
print(f"Starting to load the model {model_name} into memory")
|
| 45 |
|
| 46 |
m = AutoModelForCausalLM.from_pretrained(
|
| 47 |
model_name,
|
| 48 |
+
#load_in_4bit=True, #19GB in 4bit, 38GB with load_in_8bit, 67GB in full f16 if you just delete this line
|
| 49 |
torch_dtype=torch.bfloat16,
|
| 50 |
device_map={"": 0}
|
| 51 |
)
|
|
|
|
| 63 |
|
| 64 |
```
|
| 65 |
|
| 66 |
+
### Gradio the UI
|
| 67 |
|
| 68 |
```
|
| 69 |
|
| 70 |
+
#should all work in one click
|
|
|
|
| 71 |
import datetime
|
| 72 |
import os
|
| 73 |
from threading import Event, Thread
|