Update README.md
Browse files
README.md
CHANGED
|
@@ -92,12 +92,16 @@ prompt = f"""<example_response>
|
|
| 92 |
def example_function(x):
|
| 93 |
return x * 2
|
| 94 |
</function_code>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
<question>Document the python code above giving function description ,parameters and return type and example how to call the function.</question>
|
| 96 |
<doc>"""
|
| 97 |
-
inputs = tokenizer(prompt, return_tensors="pt")
|
| 98 |
outputs = model.generate(**inputs, max_new_tokens=450)
|
| 99 |
doc = (
|
| 100 |
-
|
| 101 |
.split("<doc>")[-1]
|
| 102 |
.split("</doc>")[0]
|
| 103 |
)
|
|
@@ -182,6 +186,10 @@ text=''' <example_response>
|
|
| 182 |
|
| 183 |
return output_html_path
|
| 184 |
</function_code>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
<question>Document the python code above giving function description ,parameters and return type and example how to call the function</question><doc>'''
|
| 186 |
```
|
| 187 |
|
|
|
|
| 92 |
def example_function(x):
|
| 93 |
return x * 2
|
| 94 |
</function_code>
|
| 95 |
+
<instructions>
|
| 96 |
+
1. In the examples while calling function use the name mentioned after `def ` in the above function_code.
|
| 97 |
+
2. In the generated docs use valid python type hints as per PEP 484.
|
| 98 |
+
</instructions>
|
| 99 |
<question>Document the python code above giving function description ,parameters and return type and example how to call the function.</question>
|
| 100 |
<doc>"""
|
| 101 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 102 |
outputs = model.generate(**inputs, max_new_tokens=450)
|
| 103 |
doc = (
|
| 104 |
+
tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 105 |
.split("<doc>")[-1]
|
| 106 |
.split("</doc>")[0]
|
| 107 |
)
|
|
|
|
| 186 |
|
| 187 |
return output_html_path
|
| 188 |
</function_code>
|
| 189 |
+
<instructions>
|
| 190 |
+
1. In the examples while calling function use the name mentioned after `def ` in the above function_code.
|
| 191 |
+
2. In the generated docs use valid python type hints as per PEP 484.
|
| 192 |
+
</instructions>
|
| 193 |
<question>Document the python code above giving function description ,parameters and return type and example how to call the function</question><doc>'''
|
| 194 |
```
|
| 195 |
|