Update README.md
Browse files
README.md
CHANGED
@@ -153,13 +153,14 @@ prompt = """
|
|
153 |
<question>
|
154 |
Generate a python function for adding two numbers.
|
155 |
</question>
|
156 |
-
<
|
157 |
"""
|
158 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
159 |
outputs = model.generate(**inputs, max_new_tokens=new_tokens)
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
163 |
```
|
164 |
|
165 |
|
|
|
153 |
<question>
|
154 |
Generate a python function for adding two numbers.
|
155 |
</question>
|
156 |
+
<code>
|
157 |
"""
|
158 |
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
159 |
outputs = model.generate(**inputs, max_new_tokens=new_tokens)
|
160 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
161 |
+
response = response.split("<code>")[1].split("</code>")[0]
|
162 |
+
|
163 |
+
print(response)
|
164 |
```
|
165 |
|
166 |
|