Commit
•
690efaf
1
Parent(s):
464032f
Update README.md
Browse files
README.md
CHANGED
@@ -76,21 +76,32 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
76 |
device = "cuda"
|
77 |
model = AutoModelForCausalLM.from_pretrained("PipableAI/pip-library-etl-1.3b").to(device)
|
78 |
tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-library-etl-1.3b")
|
79 |
-
prompt = f"""
|
80 |
-
|
81 |
-
--
|
|
|
82 |
--doc:
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
<function_code>
|
92 |
-
def
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
</function_code>
|
95 |
<instructions>
|
96 |
1. In the examples while calling function use the name mentioned after `def ` in the above function_code.
|
@@ -121,18 +132,18 @@ print(doc)
|
|
121 |
### 1. Code Documentation
|
122 |
### prompt
|
123 |
```python
|
124 |
-
prompt ='''
|
125 |
-
--code:def
|
126 |
-
--question:Document the python code above giving function description ,parameters and return type and example how to call the function
|
127 |
--doc:
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
<function_code>def _plot_bounding_polygon(
|
137 |
polygons_coordinates, output_html_path="bounding_polygon_map.html"
|
138 |
):
|
@@ -211,23 +222,32 @@ prompt =''' <example_response>
|
|
211 |
### prompt
|
212 |
```python
|
213 |
prompt = """Generate a simple SQL query from the schema mentioned for the following question.
|
214 |
-
<schema>
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
<question>What are the names of the heads who are born outside the California state?</question>
|
230 |
-
<sql>
|
|
|
231 |
```
|
232 |
|
233 |
### response
|
|
|
76 |
device = "cuda"
|
77 |
model = AutoModelForCausalLM.from_pretrained("PipableAI/pip-library-etl-1.3b").to(device)
|
78 |
tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-library-etl-1.3b")
|
79 |
+
prompt = f"""
|
80 |
+
<example_response>
|
81 |
+
--code:def divide_by_two(x: float) -> float: return x / 2
|
82 |
+
--question:Document the python code above giving function description ,parameters and return type and example on how to call the function
|
83 |
--doc:
|
84 |
+
Description: This function divides a given number by 2.
|
85 |
+
Parameters:
|
86 |
+
- x (float): The input value to be divided by 2.
|
87 |
+
Returns:
|
88 |
+
- float: The result of x divided by 2.
|
89 |
+
Example:
|
90 |
+
divide_by_two(1.0)
|
91 |
+
</example_response>
|
92 |
<function_code>
|
93 |
+
def download_file(shared_url, destination):
|
94 |
+
try:
|
95 |
+
if not shared_url.startswith("https://drive.google.com"):
|
96 |
+
raise ValueError("Please provde a valid google drive link.")
|
97 |
+
file_id = shared_url.split("/d/")[1]
|
98 |
+
file_id = file_id.split("/")[0]
|
99 |
+
url = f"https://drive.google.com/uc?id={file_id}"
|
100 |
+
gdown.download(url, destination, quiet=False)
|
101 |
+
except Exception as e:
|
102 |
+
print(f"Error downloading file from Google Drive as {e}")
|
103 |
+
raise e
|
104 |
+
"""
|
105 |
</function_code>
|
106 |
<instructions>
|
107 |
1. In the examples while calling function use the name mentioned after `def ` in the above function_code.
|
|
|
132 |
### 1. Code Documentation
|
133 |
### prompt
|
134 |
```python
|
135 |
+
prompt ='''<example_response>
|
136 |
+
--code:def divide_by_two(x: float) -> float: return x / 2
|
137 |
+
--question:Document the python code above giving function description ,parameters and return type and example on how to call the function
|
138 |
--doc:
|
139 |
+
Description: This function divides a given number by 2.
|
140 |
+
Parameters:
|
141 |
+
- x (float): The input value to be divided by 2.
|
142 |
+
Returns:
|
143 |
+
- float: The result of x divided by 2.
|
144 |
+
Example:
|
145 |
+
divide_by_two(1.0)
|
146 |
+
</example_response>
|
147 |
<function_code>def _plot_bounding_polygon(
|
148 |
polygons_coordinates, output_html_path="bounding_polygon_map.html"
|
149 |
):
|
|
|
222 |
### prompt
|
223 |
```python
|
224 |
prompt = """Generate a simple SQL query from the schema mentioned for the following question.
|
225 |
+
<schema>
|
226 |
+
CREATE TABLE department (
|
227 |
+
Department_ID number, -- Unique identifier for the department
|
228 |
+
Name text, -- Name of the department
|
229 |
+
Creation text, -- Date of creation or establishment
|
230 |
+
Ranking number, -- Ranking of the department
|
231 |
+
Budget_in_Billions number, -- Budget of the department in billions
|
232 |
+
Num_Employees number -- Number of employees in the department
|
233 |
+
);
|
234 |
+
|
235 |
+
CREATE TABLE head (
|
236 |
+
head_ID number, -- Unique identifier for the head
|
237 |
+
name text, -- Name of the head
|
238 |
+
born_state text, -- State where the head was born
|
239 |
+
age number -- Age of the head
|
240 |
+
);
|
241 |
+
|
242 |
+
CREATE TABLE management (
|
243 |
+
department_ID number, -- Foreign key referencing Department_ID in department table
|
244 |
+
head_ID number, -- Foreign key referencing head_ID in head table
|
245 |
+
temporary_acting text -- Indicates if the head is temporarily acting
|
246 |
+
);
|
247 |
+
</schema>
|
248 |
<question>What are the names of the heads who are born outside the California state?</question>
|
249 |
+
<sql>
|
250 |
+
"""
|
251 |
```
|
252 |
|
253 |
### response
|