Views
No views yet
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3# Load model and tokenizer
4tokenizer = AutoTokenizer.from_pretrained("wxkkxw/microsoft_DialoGPT-small_databricks-dolly-15k_sft")
5model = AutoModelForCausalLM.from_pretrained("wxkkxw/microsoft_DialoGPT-small_databricks-dolly-15k_sft")
6
7# Generate text
8prompt = "{example_prompt}"
9inputs = tokenizer(prompt, return_tensors="pt")
10
11outputs = model.generate(
12 **inputs,
13 max_new_tokens={max_new_tokens},
14 temperature={temperature},
15 top_p={top_p}
16)
17
18response = tokenizer.decode(outputs[0], skip_special_tokens=True)
19print(response)1@misc{{{citation_key},
2 author = {{{citation_authors}}},
3 title = {{{citation_title}}},
4 year = {{{citation_year}}},
5 publisher = {{Hugging Face}},
6 url = {{https://huggingface.co/wxkkxw/microsoft_DialoGPT-small_databricks-dolly-15k_sft}}
7}}