SasakiYusuke
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -42,13 +42,10 @@ text = '''Create a program that determines whether a given year is a leap year o
|
|
42 |
'''
|
43 |
texts = f"Translate the following problem statement into Python code. :\n{text}"
|
44 |
messages = [
|
45 |
-
{
|
46 |
-
"role": "system",
|
47 |
-
"content": "You are a chatbot who can help code!",
|
48 |
-
},
|
49 |
{"role": "user", "content": f"{texts}"},
|
50 |
]
|
51 |
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
52 |
-
outputs = pipe(prompt, max_new_tokens=
|
53 |
print(outputs[0]["generated_text"])
|
54 |
```
|
|
|
42 |
'''
|
43 |
texts = f"Translate the following problem statement into Python code. :\n{text}"
|
44 |
messages = [
|
45 |
+
{"role": "system","content": "You are a chatbot who can help code!",},
|
|
|
|
|
|
|
46 |
{"role": "user", "content": f"{texts}"},
|
47 |
]
|
48 |
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
49 |
+
outputs = pipe(prompt, max_new_tokens=512, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
50 |
print(outputs[0]["generated_text"])
|
51 |
```
|