File size: 3,642 Bytes
b24aa22 041541d b24aa22 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
---
datasets:
- heegyu/glaive-function-calling-v2-ko
---
- function call λͺ¨λΈ νμ΅ν΄λ΄€μΌλ νΈμΆ μμ μ μ λλ‘ νμ
νμ§ λͺ»ν¨ γ
..
# Usage
```
from transformers import pipeline
pipe = pipeline('text-generation', "heegyu/1213-42dot-1.3B-function-calling-v2-2e-5", device="cuda:0", revision="epoch-1")
print(pipe("""λΉμ μ λ€μκ³Ό κ°μ κΈ°λ₯μ μ κ·Όν μ μλ λμμ΄ λλ AI μ΄μμ€ν΄νΈμ
λλ€. νμνλ€λ©΄ μ΄ κΈ°λ₯λ€μ μ¬μ©νμΈμ
{
"name": "get_news_headlines",
"description": "Get the latest news headlines",
"parameters": {
"type": "object",
"properties": {
"country": {
"type": "string",
"description": "The country for which to fetch news"
}
},
"required": [ "country" ]
}
}
<human>:
μ΄μ λ―Έκ΅μμ μΌμ΄λ μ΅μ λ΄μ€κ° μκ³ μΆμ΄
<bot>:
""",
max_new_tokens=128)[0]['generated_text'])
```
μ€ν κ²°κ³Ό
```
λΉμ μ λ€μκ³Ό κ°μ κΈ°λ₯μ μ κ·Όν μ μλ λμμ΄ λλ AI μ΄μμ€ν΄νΈμ
λλ€. νμνλ€λ©΄ μ΄ κΈ°λ₯λ€μ μ¬μ©νμΈμ
{
"name": "get_news_headlines",
"description": "Get the latest news headlines",
"parameters": {
"type": "object",
"properties": {
"country": {
"type": "string",
"description": "The country for which to fetch news"
}
},
"required": [ "country" ]
}
}
<human>:
μ΄μ λ―Έκ΅μμ μΌμ΄λ μ΅μ λ΄μ€κ° μκ³ μΆμ΄
<bot>:
<function-call>{"name": "get_news_headlines", "arguments": '{"country": "United States"}'}</function-call>
```
### lemon pick
νΈμΆ μμ μ μλͺ» νμ
ν κ²½μ° responseλ‘ μ§μνμ§ μμμ νμν μλ μλ€. νμ§λ§ κ·Όλ³Έμ μΈ ν΄κ²°μ±
μ΄ νμ
```
print(pipe("""λΉμ μ λ€μκ³Ό κ°μ κΈ°λ₯μ μ κ·Όν μ μλ λμμ΄ λλ AI μ΄μμ€ν΄νΈμ
λλ€. μ¬μ©μκ° μ리λ₯Ό μ£Όλ¬Έν λλ§ μ΄ κΈ°λ₯λ€μ μ¬μ©νμΈμ. μ 곡λμ§ μμ κΈ°λ₯μ μ¬μ©νμ§ λ§μΈμ
{
"name": "order_dish",
"description": "μ¬μ©μκ° λ¨Ήκ³ μΆμ μ리λ₯Ό μ£Όλ¬Ένλ€.",
"parameters": {
"type": "object",
"properties": {
"dishes": {
"type": "list",
"description": "The list of dish names"
}
},
"required": [ "dishes" ]
}
}
<human>:
μμ μ¬λ―Έμλ λ΄μ€ μλ?
<bot>:
<function-call>{"name": "get_news", "arguments": '{"date": "today"}'}</function-call>
<human>:
<function-response>{"status": "unsupported", "message": 'μ§μνμ§ μλ κΈ°λ₯μ
λλ€.'}</function-response>
<bot>:
""",
max_new_tokens=128, do_sample=True)[0]['generated_text'])
```
κ²°κ³Ό
```
λΉμ μ λ€μκ³Ό κ°μ κΈ°λ₯μ μ κ·Όν μ μλ λμμ΄ λλ AI μ΄μμ€ν΄νΈμ
λλ€. μ¬μ©μκ° μ리λ₯Ό μ£Όλ¬Έν λλ§ μ΄ κΈ°λ₯λ€μ μ¬μ©νμΈμ. μ 곡λμ§ μμ κΈ°λ₯μ μ¬μ©νμ§ λ§μΈμ
{
"name": "order_dish",
"description": "μ¬μ©μκ° λ¨Ήκ³ μΆμ μ리λ₯Ό μ£Όλ¬Ένλ€.",
"parameters": {
"type": "object",
"properties": {
"dishes": {
"type": "list",
"description": "The list of dish names"
}
},
"required": [ "dishes" ]
}
}
<human>:
μμ μ¬λ―Έμλ λ΄μ€ μλ?
<bot>:
<function-call>{"name": "get_news", "arguments": '{"date": "today"}'}</function-call>
<human>:
<function-response>{"status": "unsupported", "message": 'μ§μνμ§ μλ κΈ°λ₯μ
λλ€.'}</function-response>
<bot>:
μ£μ‘νμ§λ§, μ λ λ΄μ€ κΈ°λ₯μ μ§μνμ§ μμ΅λλ€. μ κΈ°λ₯μ μ리λ₯Ό μ£Όλ¬Ένλ κ²μ νμ λμ΄ μμ΅λλ€. λ€λ₯Έ λμμ΄ νμνμλ©΄ μλ €μ£ΌμΈμ.
``` |