在训练管理中基于function call进行多机多卡微调Llama3-8B-Instruct模型 #75

Open
opened 2024-09-12 18:10:14 +08:00 by 12019701659cs · 0 comments

image8.png

max_length = 1664的情况

  1. 微调前

    <|start_header_id|>system<|end_header_id|>
    
    You are a assistant who can utilize external tools.
    [{'name': 'ArxivSearch.get_arxiv_article_information','description': 'Run Arxiv search and get the article meta information.','parameters': [{'name': 'query', 'type': 'STRING', 'description':'the content of search query'}],'required': ['query'],'return_data':[{'name': 'content', 'description': 'a list of 3 arxiv search papers', 'type': 'STRING'}],'parameter_description': 'If you call this tool, you must pass arguments in the JSON format{key: value}, where the key is the parameter name.'}]
    To use a tool, please use the following format:
    
    Thought:Think what you need to solve, do you need to use tools?
    Action:the tool name, should be one of [['ArxivSearch']]
    Action Input:the input to the action
    
    The response after utilizing tools should using the following format:
    
    Response:the results after call the tool.
    
    If you already know the answer, or you do not need to use tools,
    please using the following format to reply:
    
    Thought:the thought process to get the final answer
    Final Answer:final answer
    
    
    Begin!<|eot_id|><|start_header_id|>user<|end_header_id|>
    
    Please help me search the InternLM2 Technical Report.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
    
    Thought: I can help you search for the InternLM2 Technical Report using the ArxivSearch tool.
    
    Action: ArxivSearch.get_arxiv_article_information
    
    Action Input: query="InternLM2 Technical Report"
    
    Response:
    
    [
      {
    
  2. 微调后

    <|start_header_id|>system<|end_header_id|>
    
    You are a assistant who can utilize external tools.
    [{'name': 'ArxivSearch.get_arxiv_article_information','description': 'Run Arxiv search and get the article meta information.','parameters': [{'name': 'query', 'type': 'STRING', 'description':'the content of search query'}],'required': ['query'],'return_data':[{'name': 'content', 'description': 'a list of 3 arxiv search papers', 'type': 'STRING'}],'parameter_description': 'If you call this tool, you must pass arguments in the JSON format{key: value}, where the key is the parameter name.'}]
    To use a tool, please use the following format:
    
    Thought:Think what you need to solve, do you need to use tools?
    Action:the tool name, should be one of [['ArxivSearch']]
    Action Input:the input to the action
    
    The response after utilizing tools should using the following format:
    
    Response:the results after call the tool.
    
    If you already know the answer, or you do not need to use tools,
    please using the following format to reply:
    
    Thought:the thought process to get the final answer
    Final Answer:final answer
    
    Begin!<|eot_id|><|start_header_id|>user<|end_header_id|>
    
    Please help me search the InternLM2 Technical Report.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
    
    Thought: I am calling the ArxivSearch tool with the argument 'query' set to 'InternLM2 Technical Report'. This will allow me to search for the InternLM2 Technical Report on the Arxiv platform. By using this tool, I can retrieve the latest updates and information about the report.
    Action: ArxivSearch.get_arxiv_article_information
    Action Input: {"query": "InternLM2 Technical Report"}<|eot_id|>
    
    
![image8.png](/attachments/f965ae05-9e3a-4bef-8b34-4ec6d866ce17) ## max_length = 1664的情况 1. 微调前 ```bash <|start_header_id|>system<|end_header_id|> You are a assistant who can utilize external tools. [{'name': 'ArxivSearch.get_arxiv_article_information','description': 'Run Arxiv search and get the article meta information.','parameters': [{'name': 'query', 'type': 'STRING', 'description':'the content of search query'}],'required': ['query'],'return_data':[{'name': 'content', 'description': 'a list of 3 arxiv search papers', 'type': 'STRING'}],'parameter_description': 'If you call this tool, you must pass arguments in the JSON format{key: value}, where the key is the parameter name.'}] To use a tool, please use the following format: Thought:Think what you need to solve, do you need to use tools? Action:the tool name, should be one of [['ArxivSearch']] Action Input:the input to the action The response after utilizing tools should using the following format: Response:the results after call the tool. If you already know the answer, or you do not need to use tools, please using the following format to reply: Thought:the thought process to get the final answer Final Answer:final answer Begin!<|eot_id|><|start_header_id|>user<|end_header_id|> Please help me search the InternLM2 Technical Report.<|eot_id|><|start_header_id|>assistant<|end_header_id|> Thought: I can help you search for the InternLM2 Technical Report using the ArxivSearch tool. Action: ArxivSearch.get_arxiv_article_information Action Input: query="InternLM2 Technical Report" Response: [ { ``` 2. 微调后 ```bash <|start_header_id|>system<|end_header_id|> You are a assistant who can utilize external tools. [{'name': 'ArxivSearch.get_arxiv_article_information','description': 'Run Arxiv search and get the article meta information.','parameters': [{'name': 'query', 'type': 'STRING', 'description':'the content of search query'}],'required': ['query'],'return_data':[{'name': 'content', 'description': 'a list of 3 arxiv search papers', 'type': 'STRING'}],'parameter_description': 'If you call this tool, you must pass arguments in the JSON format{key: value}, where the key is the parameter name.'}] To use a tool, please use the following format: Thought:Think what you need to solve, do you need to use tools? Action:the tool name, should be one of [['ArxivSearch']] Action Input:the input to the action The response after utilizing tools should using the following format: Response:the results after call the tool. If you already know the answer, or you do not need to use tools, please using the following format to reply: Thought:the thought process to get the final answer Final Answer:final answer Begin!<|eot_id|><|start_header_id|>user<|end_header_id|> Please help me search the InternLM2 Technical Report.<|eot_id|><|start_header_id|>assistant<|end_header_id|> Thought: I am calling the ArxivSearch tool with the argument 'query' set to 'InternLM2 Technical Report'. This will allow me to search for the InternLM2 Technical Report on the Arxiv platform. By using this tool, I can retrieve the latest updates and information about the report. Action: ArxivSearch.get_arxiv_article_information Action Input: {"query": "InternLM2 Technical Report"}<|eot_id|> ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_course#75
No description provided.