huseinzol05 commited on
Commit
e9e2fb7
1 Parent(s): 5e93f26

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +45 -14
README.md CHANGED
@@ -115,9 +115,34 @@ print(tokenizer.decode(r[0]))
115
  ```
116
 
117
  ```python
118
- f = { "name": "get_exchange_rate", "description": "Get the exchange rate between two currencies", "parameters": { "type": "object", "properties": { "base_currency": { "type": "string", "description": "The currency to convert from" }, "target_currency": { "type": "string", "description": "The currency to convert to" } }, "required": [ "base_currency", "target_currency" ] } }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  messages = [
120
- {'role': 'user', 'content': 'tolong tukar 10 ringgit ke usd'}
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": "get_exchange_rate",
142
- "description": "Get the exchange rate between two currencies",
143
  "parameters": {
144
  "type": "object",
145
  "properties": {
146
- "base_currency": {
 
 
 
 
147
  "type": "string",
148
- "description": "The currency to convert from"
149
  },
150
- "target_currency": {
151
  "type": "string",
152
- "description": "The currency to convert to"
153
  }
154
  },
155
  "required": [
156
- "base_currency",
157
- "target_currency"
 
158
  ]
159
  }
160
  }
161
- [INST] tolong tukar 10 ringgit ke usd [/INST] <functioncall> {"name": "get_exchange_rate", "arguments": '{"base_currency": "MYR", "target_currency": "USD"}'}
162
-
163
-
164
- <functioncall> {"exchange_rate": 0.1457}</s>
 
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
  ```