Download loool.py from jaty54/datapython: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/datasets/jaty54/datapython/resolve/main/loool.py
- Command line
-
hf download hf://datasets/jaty54/datapython/loool.py
-
curl -L -o loool.py https://huggingface.co/datasets/jaty54/datapython/resolve/main/loool.py
514 Bytes
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| tokenizer = AutoTokenizer.from_pretrained("giulio98/codegen-350M-multi-xlcost-v2") | |
| model = AutoModelForCausalLM.from_pretrained("giulio98/codegen-350M-multi-xlcost-v2") | |
| text = tokenizer.eos_token + "\'\'\'\n" + "function to add two numbers" + "\n\'\'\'\n" + "###\n" | |
| 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)) | |