language:en region:us
---
language:
- en
---
# SmolLM2-135M-Instruct

## Code
```python
from transformers import AutoModelForCausalLM, AutoTokenizer

device = "cuda"
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-135M-Instruct")
model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-135M-Instruct").to(device)

PROMPT = "What is the key principle to effective public speaking?"
messages = [{"role": "user", "content": PROMPT}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
# add repetition_penalty=1.2 if you notice that the model repeats itself, for example when writing stories
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))
```
## Prompts and answers

- What is the key principle to effective public speaking?
```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
What is the key principle to effective public speaking?<|im_end|>
<|im_start|>assistant
The key principle to effective public speaking is to engage the audience's emotions and create a sense of connection with them. This can be achieved by using storytelling, using rhetorical devices, and using the power of storytelling to convey complex ideas in a way that resonates with the audience.

Effective public speakers also use their words to convey their message in a way that is clear, concise, and impactful. They use active listening skills to ensure that their audience is fully engaged and that their message is conveyed in a way that is both compelling and memorable.

Ultimately, the key principle to effective public speaking is to create a sense of shared experience and understanding with the audience, and to use the power of storytelling to convey that experience.<|im_end|>
```
- Summarize the theory of evolution in one paragraph
```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
Summarize the theory of evolution in one paragraph.<|im_end|>
<|im_start|>assistant
The theory of evolution, also known as the theory of evolution by natural selection, is a fundamental concept in biology that explains how species change over time through the process of adaptation and speciation. Over millions of years, natural selection acts on variations in the DNA of organisms, favoring those with traits that increase their chances of survival and reproduction. This process, which is driven by the accumulation of genetic mutations, ultimately leads to the evolution of new species.<|im_end|>
```
- Give one advice for navigating conflict in the workplace?
```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
Give one advice for navigating conflict in the workplace?<|im_end|>
<|im_start|>assistant
When navigating conflict in the workplace, it's essential to maintain a calm and professional demeanor, focusing on finding a mutually beneficial solution rather than placing blame. This can be achieved by actively listening to the other party's perspective, acknowledging their concerns, and expressing empathy. By doing so, you can diffuse tension and create a more constructive atmosphere for resolving the conflict.<|im_end|>
```
- How do you write a polite follow-up email after a job interview? Answer in one paragraph
```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
How do you write a polite follow-up email after a job interview? Answer in one paragraph<|im_end|>
<|im_start|>assistant
After a job interview, it's essential to follow up with the employer to express your continued interest in the role and inquire about any opportunities for growth or professional development. You can say something like:

"Thank you for considering me for the position at [Company Name]. I appreciate the opportunity to discuss my qualifications and experience. I'm excited about the prospect of joining the team and contributing to the company's success. I'd like to schedule a follow-up meeting to discuss my progress and any new developments. Please let me know if you have any questions or if there's anything I can do to support my application."<|im_end|>
```
- Explain gravity in one paragraph
```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
Explain gravity in one paragraph<|im_end|>
<|im_start|>assistant
Gravity is a fundamental force of nature that attracts objects with mass towards each other. It is the force that keeps us on Earth, the Moon, and the planets in their orbits. It is a result of the interaction between mass, energy, and space, and it is the weakest of the four fundamental forces of nature. Gravity is a powerful force that governs the behavior of objects on Earth, influencing everything from the motion of planets to the orbits of satellites.<|im_end|>
```
- Explain inflation in one paragraph.
```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
Explain inflation in one paragraph.<|im_end|>
<|im_start|>assistant
Inflation is the general rate of change in the general price level of goods and services in an economy over a given period. It is a measure of the rate at which the general price level of goods and services is rising, and it is often used to gauge the state of the economy. A general rate of inflation can be influenced by various factors, including changes in the money supply, interest rates, and the level of economic activity. As the general price level rises, it can lead to higher prices for goods and services, which can have a ripple effect on the broader economy.<|im_end|>
```
- Explain inflation in simple terms. (using 'in simple terms' instead of 'in one paragraph' pushes the model to do incorrect reasoning)

```
<|im_start|>system
You are a helpful AI assistant named SmolLM, trained by Hugging Face<|im_end|>
<|im_start|>user
Explain inflation in simple terms.<|im_end|>
<|im_start|>assistant
Imagine you have a big toy box with toys of different colors, sizes, and shapes. Inflation is like a price increase that makes the prices of these toys higher.

When you buy a toy, you're buying a small amount of the toy, and the price goes up. This means that the toy costs more than it used to cost. Inflation is like a price increase that happens when the toy's price goes up, making it more expensive for people to buy it.

Think of it like a big price difference between a toy and a regular toy. If the price of a toy is $10, and the price of a regular toy is $20, the price difference is $20. But if the price of a toy is $100, the price difference is $100.

Inflation is like a price increase that happens when the toy's price goes up, making it more expensive for people to buy it. It's like a price increase that happens when the toy's price goes up, making it more expensive for people to buy it.
```