Downloads · 30 days
0
0% of all-time downloads
heegyu/1213-42dot-1.3B-function-calling-v2-2e-5
1213-42dot-1.3B-function-calling-v2-2e-5 is a machine learning model from heegyu. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
- function call 모델 학습해봤으나 호출 시점을 제대로 파악하지 못함 ㅜ..
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
3
Public
Repo size
8.6 GB
Likes
0
Public
Click a slice to open those files.
.md3.6 KB · 71%
From the Hugging Face model README
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>
호출 시점을 잘못 파악한 경우 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>:
죄송하지만, 저는 뉴스 기능을 지원하지 않습니다. 제 기능은 요리를 주문하는 것에 한정되어 있습니다. 다른 도움이 필요하시면 알려주세요.