s3nh commited on
Commit
d35244e
1 Parent(s): 3c12353

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +124 -0
README.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - text-generation-inference
7
+ pipeline_tag: text-generation
8
+ ---
9
+
10
+
11
+ ## Original model card
12
+
13
+ Buy me a coffee if you like this project ;)
14
+ <a href="https://www.buymeacoffee.com/s3nh"><img src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-1.svg" alt=""></a>
15
+
16
+ #### Description
17
+
18
+ GGML Format model files for [This project](https://huggingface.co/bigcode/starcoderbase-3b).
19
+
20
+
21
+ ### inference
22
+
23
+
24
+ ```python
25
+
26
+ import ctransformers
27
+
28
+ from ctransformers import AutoModelForCausalLM
29
+
30
+ model = AutoModelForCausalLM.from_pretrained(output_dir, ggml_file,
31
+ gpu_layers=32, model_type="llama")
32
+
33
+ manual_input: str = "Tell me about your last dream, please."
34
+
35
+
36
+ llm(manual_input,
37
+ max_new_tokens=256,
38
+ temperature=0.9,
39
+ top_p= 0.7)
40
+
41
+ ```
42
+
43
+
44
+
45
+ # Original model card
46
+
47
+
48
+
49
+
50
+ ## Use
51
+
52
+ ### Intended use
53
+
54
+ The model was trained on GitHub code. As such it is _not_ an instruction model and commands like "Write a function that computes the square root." do not work well. However, by using the [Tech Assistant prompt](https://huggingface.co/datasets/bigcode/ta-prompt) you can turn it into a capable technical assistant.
55
+
56
+ **Feel free to share your generations in the Community tab!**
57
+
58
+ ### Generation
59
+ ```python
60
+ # pip install -q transformers
61
+ from transformers import AutoModelForCausalLM, AutoTokenizer
62
+
63
+ checkpoint = "bigcode/starcoderbase-3b"
64
+ device = "cuda" # for GPU usage or "cpu" for CPU usage
65
+
66
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
67
+ model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
68
+
69
+ inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
70
+ outputs = model.generate(inputs)
71
+ print(tokenizer.decode(outputs[0]))
72
+ ```
73
+
74
+ ### Fill-in-the-middle
75
+ Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:
76
+
77
+ ```python
78
+ input_text = "<fim_prefix>def print_hello_world():\n <fim_suffix>\n print('Hello world!')<fim_middle>"
79
+ inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
80
+ outputs = model.generate(inputs)
81
+ print(tokenizer.decode(outputs[0]))
82
+ ```
83
+
84
+ ### Attribution & Other Requirements
85
+
86
+ The pretraining dataset of the model was filtered for permissive licenses only. Nevertheless, the model can generate source code verbatim from the dataset. The code's license might require attribution and/or other specific requirements that must be respected. We provide a [search index](https://huggingface.co/spaces/bigcode/starcoder-search) that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
87
+
88
+ # Limitations
89
+
90
+ The model has been trained on source code from 80+ programming languages. The predominant natural language in source code is English although other languages are also present. As such the model is capable of generating code snippets provided some context but the generated code is not guaranteed to work as intended. It can be inefficient, contain bugs or exploits. See [the paper](https://drive.google.com/file/d/1cN-b9GnWtHzQRoE7M7gAEyivY0kl4BYs/view) for an in-depth discussion of the model limitations.
91
+
92
+ # Training
93
+
94
+ ## Model
95
+
96
+ - **Architecture:** GPT-2 model with multi-query attention and Fill-in-the-Middle objective
97
+ - **Pretraining steps:** 500k
98
+ - **Pretraining tokens:** 1 trillion
99
+ - **Precision:** bfloat16
100
+
101
+ ## Hardware
102
+
103
+ - **GPUs:** 256 Tesla A100
104
+ - **Training time:** 12 days
105
+
106
+ ## Software
107
+
108
+ - **Orchestration:** [Megatron-LM](https://github.com/bigcode-project/Megatron-LM)
109
+ - **Neural networks:** [PyTorch](https://github.com/pytorch/pytorch)
110
+ - **BP16 if applicable:** [apex](https://github.com/NVIDIA/apex)
111
+
112
+ # License
113
+ The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement [here](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement).
114
+ # Citation
115
+ ```
116
+ @article{li2023starcoder,
117
+ title={StarCoder: may the source be with you!},
118
+ author={Raymond Li and Loubna Ben Allal and Yangtian Zi and Niklas Muennighoff and Denis Kocetkov and Chenghao Mou and Marc Marone and Christopher Akiki and Jia Li and Jenny Chim and Qian Liu and Evgenii Zheltonozhskii and Terry Yue Zhuo and Thomas Wang and Olivier Dehaene and Mishig Davaadorj and Joel Lamy-Poirier and João Monteiro and Oleh Shliazhko and Nicolas Gontier and Nicholas Meade and Armel Zebaze and Ming-Ho Yee and Logesh Kumar Umapathi and Jian Zhu and Benjamin Lipkin and Muhtasham Oblokulov and Zhiruo Wang and Rudra Murthy and Jason Stillerman and Siva Sankalp Patel and Dmitry Abulkhanov and Marco Zocca and Manan Dey and Zhihan Zhang and Nour Fahmy and Urvashi Bhattacharyya and Wenhao Yu and Swayam Singh and Sasha Luccioni and Paulo Villegas and Maxim Kunakov and Fedor Zhdanov and Manuel Romero and Tony Lee and Nadav Timor and Jennifer Ding and Claire Schlesinger and Hailey Schoelkopf and Jan Ebert and Tri Dao and Mayank Mishra and Alex Gu and Jennifer Robinson and Carolyn Jane Anderson and Brendan Dolan-Gavitt and Danish Contractor and Siva Reddy and Daniel Fried and Dzmitry Bahdanau and Yacine Jernite and Carlos Muñoz Ferrandis and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries},
119
+ year={2023},
120
+ eprint={2305.06161},
121
+ archivePrefix={arXiv},
122
+ primaryClass={cs.CL}
123
+ }
124
+ ```