from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
from transformers import AutoTokenizer
model_name = "michaelfeil/ct2fast-gpt_bigcode-santacoder"# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
model = GeneratorCT2fromHfHub(
# load in int8 on CUDA
model_name_or_path=model_name,
device="cuda",
compute_type="int8_float16",
# tokenizer=AutoTokenizer.from_pretrained("bigcode/gpt_bigcode-santacoder")
)
outputs = model.generate(
text=["How do you call a fast Flan-ingo?", "User: How are you doing? Bot:"],
max_length=64,
include_prompt_in_result=False
)
print(outputs)
Licence and other remarks:
This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.
main_custom
: Packaged with its modeling code. Requires
transformers>=4.27
.
Alternatively, it can run on older versions by setting the configuration parameter
activation_function = "gelu_pytorch_tanh"
.
Use
Intended use
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.
You should phrase commands like they occur in source code such as comments (e.g.
# the following function computes the sqrt
) or write a function signature and docstring and let the model complete the function body.
Attribution & Other Requirements
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
that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
Limitations
The model has been trained on source code in Python, Java, and JavaScript. The predominant language in source is English although other languages are also present. As such the model is capable to generate code snippets provided some context but the generated code is not guaranteed to work as intended. It can be inefficient, contain bugs or exploits.
Training
Model
Architecture:
GPT-2 model with multi-query attention and Fill-in-the-Middle objective
ct2fast-gpt_bigcode-santacoder huggingface.co is an AI model on huggingface.co that provides ct2fast-gpt_bigcode-santacoder's model effect (), which can be used instantly with this michaelfeil ct2fast-gpt_bigcode-santacoder model. huggingface.co supports a free trial of the ct2fast-gpt_bigcode-santacoder model, and also provides paid use of the ct2fast-gpt_bigcode-santacoder. Support call ct2fast-gpt_bigcode-santacoder model through api, including Node.js, Python, http.
ct2fast-gpt_bigcode-santacoder huggingface.co is an online trial and call api platform, which integrates ct2fast-gpt_bigcode-santacoder's modeling effects, including api services, and provides a free online trial of ct2fast-gpt_bigcode-santacoder, you can try ct2fast-gpt_bigcode-santacoder online for free by clicking the link below.
michaelfeil ct2fast-gpt_bigcode-santacoder online free url in huggingface.co:
ct2fast-gpt_bigcode-santacoder is an open source model from GitHub that offers a free installation service, and any user can find ct2fast-gpt_bigcode-santacoder on GitHub to install. At the same time, huggingface.co provides the effect of ct2fast-gpt_bigcode-santacoder install, users can directly use ct2fast-gpt_bigcode-santacoder installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ct2fast-gpt_bigcode-santacoder install url in huggingface.co: