🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
docs:Correct the model type to qwen2.5 (#1402)
正经人王同学563d27efeba4
diff --git a/docs/cookbooks/cot_data_gen_sft_qwen_unsolth_upload_huggingface.ipynb b/docs/cookbooks/cot_data_gen_sft_qwen_unsolth_upload_huggingface.ipynbindex eb3705c33..b80b3b186 100644--- a/docs/cookbooks/cot_data_gen_sft_qwen_unsolth_upload_huggingface.ipynb+++ b/docs/cookbooks/cot_data_gen_sft_qwen_unsolth_upload_huggingface.ipynb@@ -7,7 +7,7 @@"id": "d80bea45"},"source": [- "# CoTdatagen with CAMEL And Sft Qwen With Unsolth And Upload Data And Model To Huggingface"+ "# CoTdatagen with CAMEL And Sft Qwen With Unsloth And Upload Data And Model To Huggingface"]},{@@ -17,7 +17,7 @@"id": "MgAnJZTCCNDl"},"source": [- "You can also check this cookbook in colab [here](https://drive.google.com/file/d/1lbcDNvzB6O50R9D3rOKefta1eyBd_baI/view?usp=sharing) (Use the colab share link)"+ "You can also check this cookbook in colab [here](https://drive.google.com/file/d/1lbcDNvzB6O50R9D3rOKefta1eyBd_baI/view?usp=sharingg) (Use the colab share link)"]},{@@ -63,7 +63,7 @@},{"cell_type": "code",- "execution_count": 1,+ "execution_count": null,"id": "87b853af","metadata": {"id": "87b853af"@@ -86,7 +86,7 @@},{"cell_type": "code",- "execution_count": 2,+ "execution_count": null,"id": "L5QKC6n3dx8B","metadata": {"id": "L5QKC6n3dx8B"@@ -101,11 +101,10 @@},{"cell_type": "code",- "execution_count": 3,+ "execution_count": null,"id": "b77fd525","metadata": {- "id": "b77fd525",- "lines_to_next_cell": 2+ "id": "b77fd525"},"outputs": [],"source": [@@ -137,11 +136,10 @@},{"cell_type": "code",- "execution_count": 4,+ "execution_count": null,"id": "5e59f61c","metadata": {- "id": "5e59f61c",- "lines_to_next_cell": 2+ "id": "5e59f61c"},"outputs": [],"source": [@@ -150,15 +148,14 @@},{"cell_type": "code",- "execution_count": 5,+ "execution_count": null,"id": "c90eae14","metadata": {"colab": {"base_uri": "https://localhost:8080/"},"id": "c90eae14",- "lines_to_next_cell": 2,- "outputId": "cdb0b34f-26a5-49e7-90bb-9da9c5365133"+ "outputId": "b3b9b51c-3afe-4297-8032-35af0c84eacf"},"outputs": [{@@ -196,11 +193,10 @@},{"cell_type": "code",- "execution_count": 6,+ "execution_count": null,"id": "3FDxQbUTjhhz","metadata": {- "id": "3FDxQbUTjhhz",- "lines_to_next_cell": 2+ "id": "3FDxQbUTjhhz"},"outputs": [],"source": [@@ -211,8 +207,7 @@"cell_type": "markdown","id": "81aWDSdDjhh0","metadata": {- "id": "81aWDSdDjhh0",- "lines_to_next_cell": 2+ "id": "81aWDSdDjhh0"},"source": ["Use ModelFactory to set up the backend model for agent\n",@@ -222,7 +217,7 @@},{"cell_type": "code",- "execution_count": 7,+ "execution_count": null,"id": "NWiLRs12jhh0","metadata": {"id": "NWiLRs12jhh0"@@ -236,7 +231,7 @@},{"cell_type": "code",- "execution_count": 8,+ "execution_count": null,"id": "nlOh4CO5jhh0","metadata": {"id": "nlOh4CO5jhh0"@@ -253,11 +248,10 @@},{"cell_type": "code",- "execution_count": 9,+ "execution_count": null,"id": "43WlRKdtjhh0","metadata": {- "id": "43WlRKdtjhh0",- "lines_to_next_cell": 2+ "id": "43WlRKdtjhh0"},"outputs": [],"source": [@@ -273,8 +267,7 @@"cell_type": "markdown","id": "ed4208d6","metadata": {- "id": "ed4208d6",- "lines_to_next_cell": 2+ "id": "ed4208d6"},"source": ["## Load Q&A data from a JSON file"@@ -300,19 +293,19 @@},{"cell_type": "code",- "execution_count": 10,+ "execution_count": null,"id": "f_wS-QDnjvQb","metadata": {"colab": {"base_uri": "https://localhost:8080/"},"id": "f_wS-QDnjvQb",- "outputId": "522dac36-9434-4591-aec3-3c759e67a0dd"+ "outputId": "def5d5f4-0e64-4469-a5fb-48a859326aff"},"outputs": [{- "name": "stdout","output_type": "stream",+ "name": "stdout","text": ["/content\n"]@@ -334,19 +327,19 @@},{"cell_type": "code",- "execution_count": 11,+ "execution_count": null,"id": "wBFPlWDojvQc","metadata": {"colab": {"base_uri": "https://localhost:8080/"},"id": "wBFPlWDojvQc",- "outputId": "05bc93f4-e89a-4257-9786-9e341627e812"+ "outputId": "bac7e15a-b13d-4488-8dc3-2d39cb57838b"},"outputs": [{- "name": "stdout","output_type": "stream",+ "name": "stdout","text": ["JSON data successfully saved to qa_data.json\n"]@@ -383,7 +376,7 @@},{"cell_type": "code",- "execution_count": 12,+ "execution_count": null,"id": "rjgxAnBAjvQc","metadata": {"id": "rjgxAnBAjvQc"@@ -398,8 +391,7 @@"cell_type": "markdown","id": "kNZEsTNJjvQc","metadata": {- "id": "kNZEsTNJjvQc",- "lines_to_next_cell": 2+ "id": "kNZEsTNJjvQc"},"source": ["## Create an instance of CoTDataGenerator"@@ -407,7 +399,7 @@},{"cell_type": "code",- "execution_count": 13,+ "execution_count": null,"id": "2IzPHXIsjvQc","metadata": {"id": "2IzPHXIsjvQc"@@ -420,11 +412,10 @@},{"cell_type": "code",- "execution_count": 14,+ "execution_count": null,"id": "SVzVLXdMjvQd","metadata": {- "id": "SVzVLXdMjvQd",- "lines_to_next_cell": 2+ "id": "SVzVLXdMjvQd"},"outputs": [],"source": [@@ -454,20 +445,19 @@},{"cell_type": "code",- "execution_count": 15,+ "execution_count": null,"id": "X-xusWtekemx","metadata": {"colab": {"base_uri": "https://localhost:8080/"},"id": "X-xusWtekemx",- "lines_to_next_cell": 2,- "outputId": "7e982ec0-db96-419b-a638-ffda19718ac4"+ "outputId": "13ff70e0-06e7-4f9d-b774-842e83f0b75c"},"outputs": [{- "name": "stdout","output_type": "stream",+ "name": "stdout","text": ["Question: What is the coefficient of $x^2y^6$ in the expansion of $\\left(\\frac{3}{5}x-\\frac{y}{2}\\right)^8$? Express your answer as a common fraction\n","AI's thought process and answer:\n",@@ -477,44 +467,47 @@"(a + b)^n = \\sum_{k=0}^{n} \\binom{n}{k} a^{n-k} b^k\n","\\]\n","\n",- "In our case, we can identify \\( a = \\frac{3}{5}x \\) and \\( b = -\\frac{y}{2} \\), and \\( n = 8 \\).\n",+ "In our case, we can identify \\( a = \\frac{3}{5}x \\) and \\( b = -\\frac{y}{2} \\), with \\( n = 8 \\).\n","\n","### Step 1: Analyze the problem requirements\n",- "We need to find the specific term in the expansion that contains \\( x^2y^6 \\). This means we need to determine the values of \\( k \\) and \\( n-k \\) such that:\n",+ "We need to find the specific term in the expansion that corresponds to \\( x^2y^6 \\). This means we need to determine the values of \\( k \\) and \\( n-k \\) such that:\n",+ "\n","- The power of \\( x \\) is 2.\n","- The power of \\( y \\) is 6.\n","\n","### Step 2: List the steps to solve the problem\n",- "1. Identify the general term in the expansion using the Binomial Theorem.\n",- "2. Set up equations based on the powers of \\( x \\) and \\( y \\).\n",- "3. Solve for \\( k \\) and \\( n-k \\).\n",- "4. Substitute \\( k \\) back into the general term to find the coefficient.\n",- "5. Simplify the coefficient to express it as a common fraction.\n",+ "1. Determine the general term in the expansion using the Binomial Theorem.\n",+ "2. Set up the equation to find \\( k \\) and \\( n-k \\) based on the powers of \\( x \\) and \\( y \\).\n",+ "3. Calculate the coefficient of the term corresponding to \\( x^2y^6 \\).\n",+ "4. Simplify the coefficient to express it as a common fraction.\n","\n","### Step 3: Execute the solution process\n",- "1. The general term in the expansion is given by:\n",+ "1. **General Term**: The general term in the expansion is given by:\n","\n","\\[\n","T_k = \\binom{8}{k} \\left(\\frac{3}{5}x\\right)^{8-k} \\left(-\\frac{y}{2}\\right)^k\n","\\]\n","\n",- "2. We need \\( (8-k) \\) to equal 2 (for \\( x^2 \\)) and \\( k \\) to equal 6 (for \\( y^6 \\)). Thus, we set up the equations:\n",- " - \\( 8 - k = 2 \\) implies \\( k = 6 \\).\n",- " - \\( k = 6 \\).\n",+ "2. **Setting up the powers**:\n",+ " - The power of \\( x \\) is \\( 8-k \\).\n",+ " - The power of \\( y \\) is \\( k \\).\n",+ " \n",+ " We want \\( 8-k = 2 \\) (for \\( x^2 \\)) and \\( k = 6 \\) (for \\( y^6 \\)). Solving \\( 8-k = 2 \\) gives \\( k = 6 \\).\n","\n",- "3. Now we can substitute \\( k = 6 \\) into the general term:\n",+ "3. **Finding the coefficient**:\n",+ " Now we substitute \\( k = 6 \\) into the general term:\n","\n","\\[\n","T_6 = \\binom{8}{6} \\left(\\frac{3}{5}x\\right)^{2} \\left(-\\frac{y}{2}\\right)^{6}\n","\\]\n","\n",- "4. Calculate \\( \\binom{8}{6} \\):\n",+ "Calculating \\( \\binom{8}{6} \\):\n","\n","\\[\n","\\binom{8}{6} = \\binom{8}{2} = \\frac{8 \\times 7}{2 \\times 1} = 28\n","\\]\n","\n",- "5. Now substitute into \\( T_6 \\):\n",+ "Now substituting \\( k = 6 \\):\n","\n","\\[\n","T_6 = 28 \\left(\\frac{3}{5}\\right)^{2} x^{2} \\left(-\\frac{y}{2}\\right)^{6}\n",@@ -532,40 +525,40 @@"\\left(-\\frac{y}{2}\\right)^{6} = \\frac{(-1)^6 y^6}{2^6} = \\frac{y^6}{64}\n","\\]\n","\n",- "6. Now combine these results:\n",+ "Now substituting these values back into \\( T_6 \\):\n","\n","\\[\n",- "T_6 = 28 \\cdot \\frac{9}{25} \\cdot x^2 \\cdot \\frac{y^6}{64}\n",+ "T_6 = 28 \\cdot \\frac{9}{25} \\cdot x^{2} \\cdot \\frac{y^6}{64}\n","\\]\n","\n",- "7. Combine the coefficients:\n",+ "Combining the coefficients:\n","\n","\\[\n",- "T_6 = 28 \\cdot \\frac{9}{25} \\cdot \\frac{1}{64} x^2 y^6 = \\frac{28 \\cdot 9}{25 \\cdot 64} x^2 y^6\n",+ "T_6 = 28 \\cdot \\frac{9}{25} \\cdot \\frac{1}{64} x^2 y^6\n","\\]\n","\n",- "Calculating \\( 28 \\cdot 9 \\):\n",+ "Calculating the coefficient:\n","\n","\\[\n",- "28 \\cdot 9 = 252\n",+ "\\text{Coefficient} = 28 \\cdot \\frac{9}{25} \\cdot \\frac{1}{64} = \\frac{28 \\cdot 9}{25 \\cdot 64}\n","\\]\n","\n",- "Thus, we have:\n",+ "Calculating \\( 28 \\cdot 9 = 252 \\):\n","\n","\\[\n",- "T_6 = \\frac{252}{1600} x^2 y^6\n",+ "\\text{Coefficient} = \\frac{252}{1600}\n","\\]\n","\n",- "### Step 4: Provide the final answer\n",- "Now, simplify \\( \\frac{252}{1600} \\):\n",+ "Now simplifying \\( \\frac{252}{1600} \\):\n","\n",- "The GCD of 252 and 1600 is 4. Dividing both the numerator and denominator by 4:\n",+ "The GCD of 252 and 1600 is 4, so we divide both by 4:\n","\n","\\[\n","\\frac{252 \\div 4}{1600 \\div 4} = \\frac{63}{400}\n","\\]\n","\n",- "Thus, the coefficient of \\( x^2y^6 \\) in the expansion of \\( \\left(\\frac{3}{5}x - \\frac{y}{2}\\right)^8 \\) is:\n",+ "### Step 4: Provide the final answer\n",+ "The coefficient of \\( x^2y^6 \\) in the expansion of \\( \\left(\\frac{3}{5}x - \\frac{y}{2}\\right)^8 \\) is:\n","\n","\\[\n","\\boxed{\\frac{63}{400}}\n",@@ -575,22 +568,20 @@"\n","Question: how many r in strawberry?\n","AI's thought process and answer:\n",- "To solve the problem of how many times the letter \"r\" appears in the word \"strawberry,\" we can follow a structured approach. Let's break it down step by step.\n",+ "To solve the problem of how many times the letter \"r\" appears in the word \"strawberry,\" we can follow a structured approach as outlined in the requirements. Let's break it down step by step.\n","\n","### Step 1: Analyze the Problem Requirements\n",- "The problem requires us to determine the frequency of the letter \"r\" in the word \"strawberry.\" This involves:\n",- "- Identifying the word we are analyzing.\n",- "- Counting the occurrences of the specific letter \"r\" within that word.\n",+ "The problem requires us to count the occurrences of the letter \"r\" in the word \"strawberry.\" This is a straightforward counting problem where we need to identify each instance of the letter \"r\" in the given word.\n","\n","### Step 2: List the Steps to Solve the Problem\n",- "To solve the problem, we can outline the following steps:\n",- "1. Identify the word we need to analyze.\n",- "2. Examine each letter in the word to see if it matches \"r.\"\n",- "3. Keep a count of how many times we find the letter \"r.\"\n",- "4. Present the final count as the answer.\n",+ "To solve this problem, we can outline the following steps:\n",+ "1. Identify the word we are analyzing, which is \"strawberry.\"\n",+ "2. Examine each letter in the word to see if it is \"r.\"\n",+ "3. Count each occurrence of the letter \"r.\"\n",+ "4. Provide the total count as the final answer.\n","\n","### Step 3: Execute the Solution Process\n",- "Now, let's execute the steps we outlined:\n",+ "Now, let's execute the steps we have outlined:\n","\n","1. **Identify the word**: The word we are analyzing is \"strawberry.\"\n","2. **Examine each letter**: We will look at each letter in \"strawberry\":\n",@@ -604,18 +595,17 @@" - r (2nd occurrence)\n"," - r (3rd occurrence)\n"," - y\n",- "\n",- "3. **Count the occurrences**: As we go through the letters:\n",- " - The first \"r\" is found in the third position.\n",- " - The second \"r\" is found in the eighth position.\n",- " - The third \"r\" is found in the ninth position.\n",- " - Therefore, we have counted a total of 3 occurrences of the letter \"r.\"\n",+ "3. **Count occurrences**: As we examine each letter, we find:\n",+ " - The first \"r\" is the 3rd letter.\n",+ " - The second \"r\" is the 8th letter.\n",+ " - The third \"r\" is the 9th letter.\n",+ " - Therefore, we have a total of 3 occurrences of the letter \"r.\"\n","\n","### Step 4: Provide the Final Answer\n","After counting, we find that the letter \"r\" appears **3 times** in the word \"strawberry.\"\n","\n","### Final Answer\n",- "The letter \"r\" appears **3 times** in the word \"strawberry.\"\n",+ "The final answer is: **3**.\n","Answer verification result: Correct\n","--------------------------------------------------\n","\n"@@ -643,8 +633,7 @@"cell_type": "markdown","id": "4oUP8FlAkemx","metadata": {- "id": "4oUP8FlAkemx",- "lines_to_next_cell": 2+ "id": "4oUP8FlAkemx"},"source": ["### Export the generated answers to a JSON file and transform these to Alpaca traing data format\n",@@ -654,14 +643,13 @@},{"cell_type": "code",- "execution_count": 16,+ "execution_count": null,"id": "wasTmIB2kemx","metadata": {"colab": {"base_uri": "https://localhost:8080/"},"id": "wasTmIB2kemx",- "lines_to_next_cell": 2,"outputId": "ec5ddc05-ae17-4bfc-f364-523913d52122"},"outputs": [@@ -696,7 +684,7 @@},{"cell_type": "code",- "execution_count": 17,+ "execution_count": null,"id": "LwnoMsfAkemy","metadata": {"id": "LwnoMsfAkemy"@@ -734,7 +722,7 @@},{"cell_type": "code",- "execution_count": 18,+ "execution_count": null,"id": "Gr3Tg_rMkemy","metadata": {"colab": {@@ -779,7 +767,7 @@},{"cell_type": "code",- "execution_count": 19,+ "execution_count": null,"id": "Re60_gb9kemy","metadata": {"id": "Re60_gb9kemy"@@ -938,7 +926,7 @@},{"cell_type": "code",- "execution_count": 20,+ "execution_count": null,"id": "bbNhujGVkemz","metadata": {"colab": {@@ -963,7 +951,7 @@},{"cell_type": "code",- "execution_count": 21,+ "execution_count": null,"id": "niF1jYibkemz","metadata": {"colab": {@@ -1033,7 +1021,7 @@"id": "71d334cc"},"source": [- "## Configure the unsolth environment"+ "## Configure the Unsloth environment"]},{@@ -1048,7 +1036,7 @@},{"cell_type": "code",- "execution_count": 22,+ "execution_count": null,"id": "3eb43acf","metadata": {"colab": {@@ -1362,7 +1350,7 @@},{"cell_type": "code",- "execution_count": 23,+ "execution_count": null,"id": "06f62072","metadata": {"colab": {@@ -1404,12 +1392,12 @@"id": "0a375254"},"source": [- "### Convert o1 data into an SFT-compliant training data format"+ "### Convert CoT data into an SFT-compliant training data format"]},{"cell_type": "code",- "execution_count": 24,+ "execution_count": null,"id": "a24f8387","metadata": {"colab": {@@ -1567,7 +1555,7 @@},{"cell_type": "code",- "execution_count": 25,+ "execution_count": null,"id": "a2c7b5bc","metadata": {"colab": {@@ -1641,7 +1629,7 @@},{"cell_type": "code",- "execution_count": 26,+ "execution_count": null,"id": "37a27cce","metadata": {"colab": {@@ -1681,7 +1669,7 @@},{"cell_type": "code",- "execution_count": 27,+ "execution_count": null,"id": "RTuNG4H2ahve","metadata": {"colab": {@@ -1977,7 +1965,7 @@},{"cell_type": "code",- "execution_count": 28,+ "execution_count": null,"id": "f65fdb42","metadata": {"colab": {@@ -2027,7 +2015,7 @@},{"cell_type": "code",- "execution_count": 29,+ "execution_count": null,"id": "BQ7pEtzR3OkV","metadata": {"colab": {@@ -2129,7 +2117,7 @@"id": "tMvU8hrtP6aK"},"source": [- "Here are the results of the official Qwen2-1.5b-instruct demo answering the same question:[Qwen2-1.5b-instruct-demo](https://huggingface.co/spaces/Qwen/Qwen2-1.5b-instruct-demo)"+ "Here are the results of the official Qwen2.5-1.5b-instruct demo answering the same question:[Qwen2.5-1.5b-instruct-demo](https://huggingface.co/spaces/Qwen/Qwen2.5)"]},{@@ -2139,7 +2127,7 @@"id": "qQ0nf0HZPuKN"},"source": [- ""+ ""]},{@@ -2153,12 +2141,12 @@"### Saving, loading finetuned models\n","To save the final model as LoRA adapters, either use Huggingface's `push_to_hub` for an online save or `save_pretrained` for a local save.\n","\n",- "**[NOTE]** This ONLY saves the LoRA adapters, and not the full model. To save to 16bit or GGUF, scroll down!"+ "**[NOTE]** This ONLY saves the LoRA adapters, and not the full model."]},{"cell_type": "code",- "execution_count": 31,+ "execution_count": null,"id": "53b39972","metadata": {"colab": {@@ -2273,7 +2261,7 @@},{"cell_type": "code",- "execution_count": 32,+ "execution_count": null,"id": "9150c9e3","metadata": {"colab": {@@ -8626,4 +8614,4 @@},"nbformat": 4,"nbformat_minor": 5-}+}\ No newline at end of file