Skip to content

Commit

Permalink
Updated prompt without special tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
kannangce committed Oct 29, 2023
1 parent 62b889e commit be5c47b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/prepare_ui_gen_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
# The template is specific for ui-gen data, be conscious when using for other data.

TEMPLATE = Template('''<s>
<|SYSTEM|>The response MUST be a valid JSON. Generate UI-DSL for the below input and context.<|END_SYSTEM|>
{%- if context -%}<|CONTEXT|>{{ context }}<|END_CONTEXT|>{%- endif -%}
<|INPUT|>{{ prompt }}<|END_INPUT|>
<|OUTPUT|>```{{ response }}```<|END_OUTPUT|>
<<SYS>>The response MUST be a valid JSON. Generate UI-DSL for the below input and context.<</SYS>>
{%- if context -%}## Input: {{ context }}{%- endif -%}
[INS]## Instruction: {{ prompt }}[/INS]
## Response: ```{{ response }}```
</s>''')

def prepare(
Expand Down
36 changes: 36 additions & 0 deletions train_ui_gen.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit be5c47b

Please sign in to comment.