Function
generate
(model, tokenizer, text, generation_config, prompt_func=get_prompt_for_generation_eval)
Source from the content-addressed store, hash-verified
| 54 | |
| 55 | |
| 56 | def generate(model, tokenizer, text, generation_config, prompt_func=get_prompt_for_generation_eval): |
| 57 | text = prompt_func(text) |
| 58 | inputs = tokenizer(text, return_tensors="pt").to("cuda:0") |
| 59 | outputs = model.generate(inputs=inputs["input_ids"], generation_config=generation_config) |
| 60 | return tokenizer.decode(outputs[0], skip_special_tokens=True) |
| 61 | |
| 62 | |
| 63 | models = ["bigscience/bloom-1b7"] |
Callers
nothing calls this directly
Tested by
no test coverage detected