PowerLM-3B is a 3B state-of-the-art small language model trained with the Power learning rate scheduler. It is trained on a wide range of open-source and synthetic datasets with permissive licenses. PowerLM-3B has shown promising results compared to other models in the size categories across various benchmarks, including natural language multi-choices, code generation, and math reasoning.
Usage
Generation
This is a simple example of how to use
PowerLM-3b
model.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda"# or "cpu"
model_path = "ibm/PowerLM-3b"
tokenizer = AutoTokenizer.from_pretrained(model_path)
# drop device_map if running on CPU
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
model.eval()
# change input text as desired
chat = [
{ "role": "user", "content": "Write a code to find the maximum value in a list of numbers." },
]
chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
# tokenize the text
input_tokens = tokenizer(chat, return_tensors="pt")
# transfer tokenized inputs to the devicefor i in input_tokens:
input_tokens[i] = input_tokens[i].to(device)
# generate output tokens
output = model.generate(**input_tokens, max_new_tokens=100)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# loop over the batch to print, in this example the batch size is 1for i in output:
print(i)
Runs of ibm PowerLM-3b on huggingface.co
11.6K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About PowerLM-3b huggingface.co Model
PowerLM-3b huggingface.co is an AI model on huggingface.co that provides PowerLM-3b's model effect (), which can be used instantly with this ibm PowerLM-3b model. huggingface.co supports a free trial of the PowerLM-3b model, and also provides paid use of the PowerLM-3b. Support call PowerLM-3b model through api, including Node.js, Python, http.
PowerLM-3b huggingface.co is an online trial and call api platform, which integrates PowerLM-3b's modeling effects, including api services, and provides a free online trial of PowerLM-3b, you can try PowerLM-3b online for free by clicking the link below.
PowerLM-3b is an open source model from GitHub that offers a free installation service, and any user can find PowerLM-3b on GitHub to install. At the same time, huggingface.co provides the effect of PowerLM-3b install, users can directly use PowerLM-3b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.