Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Salesforce CodeGen
|
3 |
+
|
4 |
+
ported salesforce codegen models to work on huggingface transformers without any extra code (the model specific code is bundled)
|
5 |
+
|
6 |
+
how to use:
|
7 |
+
|
8 |
+
`trust_remote_code` is needed because the [torch modules](https://github.com/salesforce/CodeGen/tree/main/jaxformer/hf/codegen) for the custom codegen model is bundled.
|
9 |
+
|
10 |
+
```sh
|
11 |
+
from transformers import AutoModelForCausalLM, GPT2Tokenizer
|
12 |
+
|
13 |
+
tokenizer = GPT2Tokenizer.from_pretrained(model_folder, local_files_only=True)
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(model_folder, local_files_only=True, trust_remote_code=True)
|
15 |
+
```
|