ibm-research/PowerMoE-3b

text generationtransformerstransformerssafetensorsgranitemoetext-generationarxiv:2408.13359license:apache-2.0apache-2.0
306.3K

drop device_map if running on CPU

model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device) model.eval()

change input text as desired

prompt = "Write a code to find the maximum value in a list of numbers."

tokenize the text

input_tokens = tokenizer(prompt, return_tensors="pt")

transfer tokenized inputs to the device

for 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 1

for i in output: print(i)

DEPLOY IN 60 SECONDS

Run PowerMoE-3b on Runcrate

Deploy on H100, A100, or RTX GPUs. Pay only for what you use. No setup required.