avi-pipable commited on
Commit
690efaf
1 Parent(s): 464032f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -40
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"""<example_response>
80
- --code:def function_2(x): return x / 2
81
- --question:Document the python code above giving function description ,parameters and return type and example how to call the function.
 
82
  --doc:
83
- Description:This function takes a number and divides it by 2.
84
- Parameters:
85
- - x (numeric): The input value to be divided by 2.
86
- Returns:
87
- - float: The result of x divided by 2
88
- Example:
89
- To call the function, use the following code:
90
- function2(1.0)</example_response>
91
  <function_code>
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.
@@ -121,18 +132,18 @@ print(doc)
121
  ### 1. Code Documentation
122
  ### prompt
123
  ```python
124
- prompt =''' <example_response>
125
- --code:def function_2(x): return x / 2
126
- --question:Document the python code above giving function description ,parameters and return type and example how to call the function.
127
  --doc:
128
- Description:This function takes a number and divides it by 2.
129
- Parameters:
130
- - x (numeric): The input value to be divided by 2.
131
- Returns:
132
- - float: The result of x divided by 2
133
- Example:
134
- To call the function, use the following code:
135
- function2(1.0)</example_response>
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>CREATE TABLE department (Department_ID number,
215
- Name text,
216
- Creation text,
217
- Ranking number,
218
- Budget_in_Billions number,
219
- Num_Employees number);
220
-
221
- CREATE TABLE head (head_ID number,
222
- name text,
223
- born_state text,
224
- age number);
225
-
226
- CREATE TABLE management (department_ID number,
227
- head_ID number,
228
- temporary_acting text);</schema>
 
 
 
 
 
 
 
 
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