mariasandu commited on
Commit
cef30a1
·
verified ·
1 Parent(s): b7ddb34

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -21,12 +21,12 @@ import torch
21
  from transformers import pipeline, AutoTokenizer
22
 
23
  question = "Write a Python function that takes a list of numbers and returns the list sorted in ascending order without using the built-in `sorted()` function."
24
- generator = pipeline("text-generation", model="mariasandu/python-coding-assistant-v2", device="cpu")
25
 
26
  tokenizer = AutoTokenizer.from_pretrained("mariasandu/python-coding-assistant-v2")
27
  tokenizer.chat_template = "{% for message in messages %}{% if message['role'] == 'user' %}[INST] {{ message['content'] }} [/INST]{% else %}{{ message['content'] }}{% endif %}{% endfor %}"
28
- output = generator(question)
29
- print(output["generated_text"])
30
  ```
31
 
32
  ## Training procedure
 
21
  from transformers import pipeline, AutoTokenizer
22
 
23
  question = "Write a Python function that takes a list of numbers and returns the list sorted in ascending order without using the built-in `sorted()` function."
24
+ generator = pipeline("text-generation", model="mariasandu/python-coding-assistant-v2", device="cuda")
25
 
26
  tokenizer = AutoTokenizer.from_pretrained("mariasandu/python-coding-assistant-v2")
27
  tokenizer.chat_template = "{% for message in messages %}{% if message['role'] == 'user' %}[INST] {{ message['content'] }} [/INST]{% else %}{{ message['content'] }}{% endif %}{% endfor %}"
28
+ output = generator(question)[0]
29
+ print(output['generated_text'])
30
  ```
31
 
32
  ## Training procedure