Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: bigscience-openrail-m
|
| 3 |
+
datasets:
|
| 4 |
+
- nuprl/MultiPL-T
|
| 5 |
+
metrics:
|
| 6 |
+
- code_eval
|
| 7 |
+
library_name: transformers
|
| 8 |
+
tags:
|
| 9 |
+
- code
|
| 10 |
+
- gpt_bigcode
|
| 11 |
+
model-index:
|
| 12 |
+
- name: MultiPLCoder-15b-Lua
|
| 13 |
+
results:
|
| 14 |
+
- task:
|
| 15 |
+
type: text-generation
|
| 16 |
+
dataset:
|
| 17 |
+
type: nuprl/MultiPL-E
|
| 18 |
+
name: MultiPL-HumanEval (Lua)
|
| 19 |
+
metrics:
|
| 20 |
+
- name: pass@1
|
| 21 |
+
type: pass@1
|
| 22 |
+
value: 0.31
|
| 23 |
+
verified: true
|
| 24 |
+
- name: MultiPLCoder-15b-Racket
|
| 25 |
+
results:
|
| 26 |
+
- task:
|
| 27 |
+
type: text-generation
|
| 28 |
+
dataset:
|
| 29 |
+
type: nuprl/MultiPL-E
|
| 30 |
+
name: MultiPL-HumanEval (Racket)
|
| 31 |
+
metrics:
|
| 32 |
+
- name: pass@1
|
| 33 |
+
type: pass@1
|
| 34 |
+
value: 0.21
|
| 35 |
+
verified: true
|
| 36 |
+
- name: MultiPLCoder-15b-OCaml
|
| 37 |
+
results:
|
| 38 |
+
- task:
|
| 39 |
+
type: text-generation
|
| 40 |
+
dataset:
|
| 41 |
+
type: nuprl/MultiPL-E
|
| 42 |
+
name: MultiPL-HumanEval (OCaml)
|
| 43 |
+
metrics:
|
| 44 |
+
- name: pass@1
|
| 45 |
+
type: pass@1
|
| 46 |
+
value: 0.199
|
| 47 |
+
verified: true
|
| 48 |
+
---
|
| 49 |
+
# MultiPLCoder-15b
|
| 50 |
+
|
| 51 |
+
15 billion parameter version of MultiPLCoder, a set of StarCoder-based models finetuned on the MultiPL-T dataset.
|
| 52 |
+
These models are state-of-the-art at low-resource languages, such as: Lua, Racket, and OCaml.
|
| 53 |
+
|
| 54 |
+
This 15 billion parameter model is the most capable of the MultiPLCoder family. However, it requires a dedicated GPU for inference.
|
| 55 |
+
For a smaller model that fits on the CPU, check out [MultiPLCoder-1b](https://huggingface.co/nuprl/MultiPLCoder-1b).
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
## Language Revision Index
|
| 59 |
+
|
| 60 |
+
This is the revision index for the best-performing models for their respective langauge.
|
| 61 |
+
|
| 62 |
+
| Langauge | Revision ID | Epoch |
|
| 63 |
+
| ------------- | ----------- | ----- |
|
| 64 |
+
| Lua | `6069aa54dd554404dd18fccdf5dedd56b8088e74` | 4 |
|
| 65 |
+
| Racket | `f0c77c06482f436f469007f20d731cb9dd73d609` | 8 |
|
| 66 |
+
| OCaml | `e7babda985786810707200ff885df6105de7dc56` | 4 |
|
| 67 |
+
|
| 68 |
+
## Usage
|
| 69 |
+
|
| 70 |
+
To utilize one of the models in this repository, you must first select a commit revision for that model from the table above.
|
| 71 |
+
For example, to use the Lua model:
|
| 72 |
+
```py
|
| 73 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 74 |
+
tokenizer = AutoTokenizer.from_pretrained("nuprl/MultiPLCoder-15b")
|
| 75 |
+
lua_revision="6069aa54dd554404dd18fccdf5dedd56b8088e74"
|
| 76 |
+
model = AutoModelForCausalLM.from_pretrained("nuprl/MultiPLCoder-15b", revision=lua_revision).cuda()
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
Note that the model's default configuration does not enable caching, therefore you must specify to use the cache on generation.
|
| 80 |
+
```py
|
| 81 |
+
toks = tokenizer.encode("-- Fibonacci iterative", return_tensors="pt")
|
| 82 |
+
out = model.generate(toks, use_cache=True, do_sample=True, temperature=0.2, top_p=0.95, max_length=50)
|
| 83 |
+
print(tokenizer.decode(out[0], skip_special_tokens=True))
|
| 84 |
+
```
|
| 85 |
+
```
|
| 86 |
+
-- Fibonacci iterative.
|
| 87 |
+
local function fib_iterative(n)
|
| 88 |
+
if n == 0 or n == 1 then
|
| 89 |
+
return n
|
| 90 |
+
end
|
| 91 |
+
local previous, current = 0, 1
|
| 92 |
+
for _ = 2, n do
|
| 93 |
+
previous, current = current, current + previous
|
| 94 |
+
end
|
| 95 |
+
return current
|
| 96 |
+
end
|
| 97 |
+
```
|