Revert commit for build_prompt
Browse files
README.md
CHANGED
@@ -21,7 +21,7 @@ extra_gated_fields:
|
|
21 |
Affiliation: text
|
22 |
---
|
23 |
|
24 |
-
|
25 |
<p align="center">
|
26 |
<img width="500px" alt="xLAM" src="https://huggingface.co/datasets/jianguozhang/logos/resolve/main/xlam-no-background.png">
|
27 |
</p>
|
@@ -202,29 +202,11 @@ def build_conversation_history_prompt(conversation_history: str):
|
|
202 |
|
203 |
|
204 |
# Helper function to build the input prompt for our model
|
205 |
-
def build_prompt(task_instruction: str, format_instruction: str, tools: list, query: str
|
206 |
-
prompt = f"[BEGIN OF TASK INSTRUCTION]
|
207 |
-
{
|
208 |
-
[END OF
|
209 |
-
|
210 |
-
"
|
211 |
-
prompt += f"[BEGIN OF AVAILABLE TOOLS]
|
212 |
-
{json.dumps(xlam_format_tools)}
|
213 |
-
[END OF AVAILABLE TOOLS]
|
214 |
-
|
215 |
-
"
|
216 |
-
prompt += f"[BEGIN OF FORMAT INSTRUCTION]
|
217 |
-
{format_instruction}
|
218 |
-
[END OF FORMAT INSTRUCTION]
|
219 |
-
|
220 |
-
"
|
221 |
-
prompt += f"[BEGIN OF QUERY]
|
222 |
-
{query}
|
223 |
-
[END OF QUERY]
|
224 |
-
|
225 |
-
"
|
226 |
-
|
227 |
-
if len(conversation_history) > 0: prompt += build_conversation_history_prompt(conversation_history)
|
228 |
return prompt
|
229 |
|
230 |
# Build the input and start the inference
|
@@ -503,5 +485,4 @@ If you find this repo helpful, please consider to cite our papers:
|
|
503 |
journal={arXiv preprint arXiv:2402.15506},
|
504 |
year={2024}
|
505 |
}
|
506 |
-
```
|
507 |
```
|
|
|
21 |
Affiliation: text
|
22 |
---
|
23 |
|
24 |
+
|
25 |
<p align="center">
|
26 |
<img width="500px" alt="xLAM" src="https://huggingface.co/datasets/jianguozhang/logos/resolve/main/xlam-no-background.png">
|
27 |
</p>
|
|
|
202 |
|
203 |
|
204 |
# Helper function to build the input prompt for our model
|
205 |
+
def build_prompt(task_instruction: str, format_instruction: str, tools: list, query: str):
|
206 |
+
prompt = f"[BEGIN OF TASK INSTRUCTION]\n{task_instruction}\n[END OF TASK INSTRUCTION]\n\n"
|
207 |
+
prompt += f"[BEGIN OF AVAILABLE TOOLS]\n{json.dumps(xlam_format_tools)}\n[END OF AVAILABLE TOOLS]\n\n"
|
208 |
+
prompt += f"[BEGIN OF FORMAT INSTRUCTION]\n{format_instruction}\n[END OF FORMAT INSTRUCTION]\n\n"
|
209 |
+
prompt += f"[BEGIN OF QUERY]\n{query}\n[END OF QUERY]\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
return prompt
|
211 |
|
212 |
# Build the input and start the inference
|
|
|
485 |
journal={arXiv preprint arXiv:2402.15506},
|
486 |
year={2024}
|
487 |
}
|
|
|
488 |
```
|