CoolFace
Modelpublic

Colby/tiny-starcoder-eluse

sourceHugging Faceotherupdated 2y agoView on Hugging Face
0likes32downloads
README.md48 linesDownload Raw Back to root
1---2tags:3- autotrain4- text-generation-inference5- text-generation6- peft7library_name: transformers8base_model: bigcode/tiny_starcoder_py9widget:10  - messages:11      - role: user12        content: What is your favorite condiment?13license: other14datasets:15- manhan/eluse-change-corpus16---17 18# Model Trained Using AutoTrain19 20This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).21 22# Usage23 24```python25 26from transformers import AutoModelForCausalLM, AutoTokenizer27 28model_path = "PATH_TO_THIS_REPO"29 30tokenizer = AutoTokenizer.from_pretrained(model_path)31model = AutoModelForCausalLM.from_pretrained(32    model_path,33    device_map="auto",34    torch_dtype='auto'35).eval()36 37# Prompt content: "hi"38messages = [39    {"role": "user", "content": "hi"}40]41 42input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')43output_ids = model.generate(input_ids.to('cuda'))44response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)45 46# Model response: "Hello! How can I assist you today?"47print(response)48```