Downloads · 30 days
45
8% of all-time downloads
helenai/Salesforce-codegen2-1B-ov
Salesforce-codegen2-1B-ov is a text generation model from helenai. Use it when you need the model to write or continue text. It is set up for transformers.
This is the Salesforce/codegen2-1B model converted to OpenVINO, for accelerated inference.
Downloads · 30 days
45
8% of all-time downloads
All-time downloads
551
Public
Repo size
5.1 GB
Likes
0
Public
Click a slice to open those files.
.bin4.1 GB · 100%
From the Hugging Face model README
This is the Salesforce/codegen2-1B model converted to OpenVINO, for accelerated inference.
An example of how to do inference on this model:
from transformers import AutoTokenizer
from optimum.intel.openvino import OVModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("helenai/Salesforce-codegen2-1B-ov")
model = OVModelForCausalLM.from_pretrained("helenai/Salesforce-codegen2-1B-ov")
# Try the version with quantized model weights by changing the line above to:
# model = OVModelForCausalLM.from_pretrained("helenai/Salesforce-codegen2-1B-ov", revision="compressed_weights")
text = "def hello_world():"
input_ids = tokenizer(text, return_tensors="pt").input_ids
generated_ids = model.generate(input_ids, max_length=128)
print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))