CoolFace
Modelpublic

winstcha/3B-htmlonly

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