pratham-pi commited on
Commit
ca8b07f
·
verified ·
1 Parent(s): aceac3b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -4
README.md CHANGED
@@ -153,13 +153,14 @@ prompt = """
153
  <question>
154
  Generate a python function for adding two numbers.
155
  </question>
156
- <response>
157
  """
158
  inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
159
  outputs = model.generate(**inputs, max_new_tokens=new_tokens)
160
- out = (
161
- tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
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