Skip to content

Instantly share code, notes, and snippets.

@nimishbongale
Created September 24, 2024 08:30
Show Gist options
  • Select an option

  • Save nimishbongale/f7e401107e8cbfe5af12b326232c6c6b to your computer and use it in GitHub Desktop.

Select an option

Save nimishbongale/f7e401107e8cbfe5af12b326232c6c6b to your computer and use it in GitHub Desktop.
messages = [
{"role": "user", "content": "Can you provide ways to eat combinations of bananas and dragonfruits?"},
{"role": "assistant", "content": "Sure! Here are some ways to eat bananas and dragonfruits together: 1. Banana and dragonfruit smoothie: Blend bananas and dragonfruits together with some milk and honey. 2. Banana and dragonfruit salad: Mix sliced bananas and dragonfruits together with some lemon juice and honey."},
{"role": "user", "content": "What about solving an 2x + 3 = 7 equation?"},
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": 0.0,
"do_sample": False,
}
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment