huseinzol05
commited on
Commit
•
e9e2fb7
1
Parent(s):
5e93f26
Update README.md
Browse files
README.md
CHANGED
@@ -115,9 +115,34 @@ print(tokenizer.decode(r[0]))
|
|
115 |
```
|
116 |
|
117 |
```python
|
118 |
-
f = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
messages = [
|
120 |
-
{'role': 'user', 'content': '
|
121 |
]
|
122 |
prompt = parse_mistral_chat(messages, function_call = [f])
|
123 |
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False).to('cuda')
|
@@ -138,28 +163,34 @@ print(tokenizer.decode(r[0]))
|
|
138 |
<s>
|
139 |
[FUNCTIONCALL]
|
140 |
{
|
141 |
-
"name": "
|
142 |
-
"description": "
|
143 |
"parameters": {
|
144 |
"type": "object",
|
145 |
"properties": {
|
146 |
-
"
|
|
|
|
|
|
|
|
|
147 |
"type": "string",
|
148 |
-
"description": "
|
149 |
},
|
150 |
-
"
|
151 |
"type": "string",
|
152 |
-
"description": "
|
153 |
}
|
154 |
},
|
155 |
"required": [
|
156 |
-
"
|
157 |
-
"
|
|
|
158 |
]
|
159 |
}
|
160 |
}
|
161 |
-
[INST]
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
165 |
```
|
|
|
115 |
```
|
116 |
|
117 |
```python
|
118 |
+
f = {
|
119 |
+
'name': 'parse_entities',
|
120 |
+
'description': 'extract entities from the text',
|
121 |
+
'parameters': {
|
122 |
+
'type': 'object',
|
123 |
+
'properties': {
|
124 |
+
'drink': {
|
125 |
+
'type': 'string',
|
126 |
+
'description': 'drink name',
|
127 |
+
},
|
128 |
+
'event': {
|
129 |
+
'type': 'string',
|
130 |
+
'description': 'event name',
|
131 |
+
},
|
132 |
+
'person_name': {
|
133 |
+
'type': 'string',
|
134 |
+
'description': 'person name',
|
135 |
+
}
|
136 |
+
},
|
137 |
+
'required': [
|
138 |
+
'drink',
|
139 |
+
'event',
|
140 |
+
'person_name'
|
141 |
+
]
|
142 |
+
}
|
143 |
+
}
|
144 |
messages = [
|
145 |
+
{'role': 'user', 'content': 'nama saya husein bin zolkepli, saya sekarang berada di jomheboh 2023 sambil minum starbucks'}
|
146 |
]
|
147 |
prompt = parse_mistral_chat(messages, function_call = [f])
|
148 |
inputs = tokenizer([prompt], return_tensors='pt', add_special_tokens=False).to('cuda')
|
|
|
163 |
<s>
|
164 |
[FUNCTIONCALL]
|
165 |
{
|
166 |
+
"name": "parse_entities",
|
167 |
+
"description": "extract entities from the text",
|
168 |
"parameters": {
|
169 |
"type": "object",
|
170 |
"properties": {
|
171 |
+
"drink": {
|
172 |
+
"type": "string",
|
173 |
+
"description": "drink name"
|
174 |
+
},
|
175 |
+
"event": {
|
176 |
"type": "string",
|
177 |
+
"description": "event name"
|
178 |
},
|
179 |
+
"person_name": {
|
180 |
"type": "string",
|
181 |
+
"description": "person name"
|
182 |
}
|
183 |
},
|
184 |
"required": [
|
185 |
+
"drink",
|
186 |
+
"event",
|
187 |
+
"person_name"
|
188 |
]
|
189 |
}
|
190 |
}
|
191 |
+
[INST] nama saya husein bin zolkepli, saya sekarang berada di jomheboh 2023 sambil minum starbucks [/INST] <functioncall> {"name": "parse_entities", "arguments": '{
|
192 |
+
"drink": "Starbucks",
|
193 |
+
"event": "Jom Heboh 2023",
|
194 |
+
"person_name": "Husein Bin Zolkepli"
|
195 |
+
}'}</s>
|
196 |
```
|