diff --git a/Class1/class1/Task1.1_MCP+Claude_Output.md b/Class1/class1/Task1.1_MCP+Claude_Output.md new file mode 100644 index 0000000..716a62e --- /dev/null +++ b/Class1/class1/Task1.1_MCP+Claude_Output.md @@ -0,0 +1,18 @@ + +### 1. Brave Search MCP output screenshot +![Brave Search MCP output](Task1.1_MCP_Claude/Brave_Search.png) + +### 2. Github MCP output screenshot +![Github MCP output](Task1.1_MCP_Claude/github_API.png) + +### 3.Puppeteer MCP output screenshot +![Puppeteer MCP output](Task1.1_MCP_Claude/Puppeteer.png) + +### 4.Filesystem MCP output screenshot +![Filesystem MCP output](Task1.1_MCP_Claude/Filesystem.png) + +### 5.Sequential Thinking MCP output screenshot +![Sequential MCP output](Task1.1_MCP_Claude/Sequential_Thinking.png) + +### 6.Notion MCP output screenshot +![Notion MCP output](Task1.1_MCP_Claude/Notion.png) diff --git a/Class1/class1/Task1.1_MCP_Claude/Brave_Search.png b/Class1/class1/Task1.1_MCP_Claude/Brave_Search.png new file mode 100644 index 0000000..917ecce Binary files /dev/null and b/Class1/class1/Task1.1_MCP_Claude/Brave_Search.png differ diff --git a/Class1/class1/Task1.1_MCP_Claude/Filesystem.png b/Class1/class1/Task1.1_MCP_Claude/Filesystem.png new file mode 100644 index 0000000..a0e25d3 Binary files /dev/null and b/Class1/class1/Task1.1_MCP_Claude/Filesystem.png differ diff --git a/Class1/class1/Task1.1_MCP_Claude/Notion.png b/Class1/class1/Task1.1_MCP_Claude/Notion.png new file mode 100644 index 0000000..ab21000 Binary files /dev/null and b/Class1/class1/Task1.1_MCP_Claude/Notion.png differ diff --git a/Class1/class1/Task1.1_MCP_Claude/Puppeteer.png b/Class1/class1/Task1.1_MCP_Claude/Puppeteer.png new file mode 100644 index 0000000..c9fc908 Binary files /dev/null and b/Class1/class1/Task1.1_MCP_Claude/Puppeteer.png differ diff --git a/Class1/class1/Task1.1_MCP_Claude/Sequential_Thinking.png b/Class1/class1/Task1.1_MCP_Claude/Sequential_Thinking.png new file mode 100644 index 0000000..fbc0472 Binary files /dev/null and b/Class1/class1/Task1.1_MCP_Claude/Sequential_Thinking.png differ diff --git a/Class1/class1/Task1.1_MCP_Claude/github_API.png b/Class1/class1/Task1.1_MCP_Claude/github_API.png new file mode 100644 index 0000000..c6b5409 Binary files /dev/null and b/Class1/class1/Task1.1_MCP_Claude/github_API.png differ diff --git a/Class1/class1/Task2.2_OllamaOpenAI.ipynb b/Class1/class1/Task2.2_OllamaOpenAI.ipynb new file mode 100644 index 0000000..021b2e3 --- /dev/null +++ b/Class1/class1/Task2.2_OllamaOpenAI.ipynb @@ -0,0 +1,80 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "id": "1bf7b177", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Title: Glowing Skin Tips: How to Make Your Face Look Bright and Radiant\n", + "Introduction:\n", + "Are you tired of looking in the mirror and seeing a dull, lackluster complexion? Do you want to improve your skin's radiance and brightness? You're in luck! In this article, we'll share practical tips and tricks on how to make your face skin look brighter and more radiant. Keep reading to learn the secrets to achieving a glowing complexion.\n", + "\n", + "Section 1: Cleanse Your Skin Properly\n", + "Cleansing your skin is the first step to having brighter, smoother skin. Use a gentle cleanser that suits your skin type, such as a micellar water for normal or oily skin, and a foaming gel or cream for dry or sensitive skin. Be sure to remove all makeup before bedtime and wash your face in the morning immediately after waking up.\n", + "\n", + "Section 2: Exfoliate Regularly\n", + "Exfoliating helps remove dead skin cells, giving your face a brighter appearance. Use a gentle exfoliating scrub or a chemical exfoliant containing alpha-hydroxy acids (AHAs) or beta-hydroxy acids (BHAs) one to two times per week. Avoid over-exfoliating, as it can cause irritation and dryness.\n", + "\n", + "Section 3: Hydrate Properly\n", + "Drinking plenty of water throughout the day is crucial for maintaining healthy, hydrated skin. Keep a water bottle with you at all times to ensure you consume enough fluids throughout the day. Apply an adequate amount of facial moisturizer after cleansing and toning to lock in hydration and protect your skin from environmental stressors.\n", + "\n", + "Section 4: Use Brightening Products\n", + "Brightening products, such as vitamin C serums or light-diffusing primers, can help address dullness and darker areas of the complexion. Look for products containing ingredients like licorice extract, caffeine, or niacinamide, which have a brightening effect on the skin. Apply these products to your face after cleansing and toning for optimal results.\n", + "\n", + "Section 5: Protect Your Skin from the Sun\n", + "UV rays can accelerate aging and cause dullness in your skin. Use a broad-spectrum sunscreen with an SPF of at least 30 whenever you go out, even on cloudy days or during winter. Apply it 15 minutes before exposure to the sun and reapply every two hours or immediately after swimming or sweating.\n", + "\n", + "Section 6: Get Enough Sleep\n", + "Lack of sleep can lead to dull-looking skin, dark circles, and puffiness. Aim for at least seven to nine hours of sound sleep each night. Establish a consistent sleep schedule and create a relaxing bedtime routine to help improve the quality of your sleep.\n", + "\n", + "Conclusion:\n", + "By following these tips consistently, you can achieve a brighter, more radiant complexion. Remember, patience is key, as it may take some time for the full effects of these methods to become apparent. Be gentle with your skin and never hesitate to consult a dermatologist if any concerns persist. Keep smiling and stay beautiful!\n" + ] + } + ], + "source": [ + "from openai import OpenAI\n", + "\n", + "client = OpenAI(\n", + " base_url = 'http://localhost:11434/v1',\n", + " api_key='ollama', # required, but unused\n", + ")\n", + "\n", + "response = client.chat.completions.create(\n", + " model=\"llama2\",\n", + " messages=[\n", + " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n", + " {\"role\": \"user\", \"content\": \"how to makes my face skin more bright?\"}\n", + " ]\n", + ")\n", + "print(response.choices[0].message.content)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Class1/class1/Task3.1_LangChain.ipynb b/Class1/class1/Task3.1_LangChain.ipynb new file mode 100644 index 0000000..486b931 --- /dev/null +++ b/Class1/class1/Task3.1_LangChain.ipynb @@ -0,0 +1,103 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "5261f590", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "User prompt: How to cook Paella?\n", + "Model answer: \n", + "Paella is a traditional Spanish dish that originated in the Valencia region. It is a savory rice dish made with a variety of ingredients, including meats, vegetables, and spices. Here is a basic recipe for cooking paella:\n", + "\n", + "Ingredients:\n", + "\n", + "* 1 cup uncooked white rice\n", + "* 2 cups water\n", + "* 1 tablespoon olive oil\n", + "* 1 onion, diced\n", + "* 2 cloves garlic, minced\n", + "* 1 pound chicken, cut into bite-sized pieces\n", + "* 1 pound shrimp, peeled and deveined\n", + "* 1 red bell pepper, diced\n", + "* 1 green pepper, diced\n", + "* 1 small tomato, diced\n", + "* 1 teaspoon smoked paprika (optional)\n", + "* Salt and pepper, to taste\n", + "* Fresh parsley, chopped (optional)\n", + "\n", + "Instructions:\n", + "\n", + "1. Heat the olive oil in a large, shallow pan over medium-high heat. Add the diced onion and cook until softened, about 5 minutes.\n", + "2. Add the minced garlic and cook for an additional 1-2 minutes, until fragrant.\n", + "3. Add the chicken and cook until browned on all sides, about 5-7 minutes. Remove from the pan and set aside.\n", + "4. Add the shrimp to the pan and cook until pink and fully cooked, about 3-4 minutes. Remove from the pan and set aside with the chicken.\n", + "5. Add the diced red and green peppers to the pan and cook until tender, about 5 minutes.\n", + "6. Add the diced tomato to the pan and cook for an additional 2-3 minutes, until slightly softened.\n", + "7. Stir in the smoked paprika (if using) and cook for 1-2 minutes, until fragrant.\n", + "8. Add the uncooked rice to the pan and stir to combine with the vegetables and spices. Cook for 2-3 minutes, until the rice is lightly browned.\n", + "9. Pour in the water and bring the mixture to a boil. Reduce the heat to low and cover the pan with a lid, simmering for 18-20 minutes, or until the rice is cooked and the liquid has been absorbed.\n", + "10. Once the paella is cooked, remove it from the heat and let it rest for 5-10 minutes before serving. Garnish with chopped fresh parsley (if desired) and serve hot.\n", + "\n", + "Enjoy your delicious homemade paella!\n" + ] + } + ], + "source": [ + "# Example: Using LCEL to reproduce a \"Basic Prompting\" scenario\n", + "from langchain_core.prompts import PromptTemplate\n", + "from langchain_core.output_parsers import StrOutputParser\n", + "from langchain_core.runnables import RunnablePassthrough\n", + "from langchain_community.chat_models import ChatOllama \n", + "\n", + "# 2. Define the prompt\n", + "prompt = PromptTemplate.from_template(\n", + " \"{topic}\"\n", + ")\n", + "\n", + "# 3. Define the model\n", + "model = ChatOllama(model = \"llama2\") # Using Ollama2 \n", + "\n", + "# 4. Chain the components together using LCEL\n", + "chain = (\n", + " # LCEL syntax: use the pipe operator | to connect each step\n", + " {\"topic\": RunnablePassthrough()} # Accept user input\n", + " | prompt # Transform it into a prompt message\n", + " | model # Call the model\n", + " | StrOutputParser() # Parse the output as a string\n", + ")\n", + "\n", + "# 5. Execute\n", + "Qestion = \"How to cook Paella?\" # Define your question here\n", + "result = chain.invoke({\"topic\": Qestion})\n", + "print(\"User prompt:\", Qestion)\n", + "print(\"Model answer:\", result)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Class1/class1/claude_desktop_config.json b/Class1/class1/claude_desktop_config.json new file mode 100644 index 0000000..7d37fff --- /dev/null +++ b/Class1/class1/claude_desktop_config.json @@ -0,0 +1,71 @@ +{ + "mcpServers": { + "brave-search": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-brave-search" + ], + "env": { + "BRAVE_API_KEY": "${BRAVE_API_KEY}" + } + }, + "github": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-github" + ], + "env": { + "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}" + } + }, + "puppeteer": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-puppeteer" + ] + }, + "memory": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-memory" + ] + }, + "everything": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-everything" + ] + }, + "filesystem": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-filesystem", + "C:\\Users\\keanu" + ] + }, + "sequential-thinking": { + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-sequential-thinking" + ] + }, + "notion": { + "command": "npx", + "args": [ + "-y", + "@suekou/mcp-notion-server" + ], + "env": { + "NOTION_API_TOKEN": "${NOTION_API_TOKEN}" + } + } + } + } + diff --git a/class2/Tesseract/IB_learner_profile.png b/class2/Tesseract/IB_learner_profile.png new file mode 100644 index 0000000..a849168 Binary files /dev/null and b/class2/Tesseract/IB_learner_profile.png differ diff --git a/class2/Tesseract/chi_characters.txt b/class2/Tesseract/chi_characters.txt new file mode 100644 index 0000000..052b079 --- /dev/null +++ b/class2/Tesseract/chi_characters.txt @@ -0,0 +1,28 @@ +uodeen SKUMuAau + +Joydeem 大 容 量 和 面 机 HMJ-A501 智 能 揉 面 机 全 自 动 +接 面 机 恒 温 发 酵 304 不 锈 钢 压 面 醒 面 一 体 5L + +5L 大 容 量 , 智 能 接 面 , 省 时 省 力 + +CAS169.00 csszaree + +E + +用 动 后 CASI000 | Sing ece + +。 仿 手 工 押 招 西 , 轻 松 探 出 井 光 雨 团 , 外 表 光 温 , 内 里 炼 道 +。 佰 湘 腾 发 , 省 阡 省 力 , 与 日 轻 林 刹 作 深 木 团 + +。 5 大 容 蛎 , 一 次 史 接 4 8 厂 团 , 海 居 全 家 羔 胎 需 永 + +十 字 颖 菊 设 计 , 面 团 命 力 的 下 , 中 泓 扬 租 林 + +。 贺 炎 不 锋 锭 积 西 椿 积 面 刀 , 材 质 坂 国 酒 用 , 俊 用 宇 + +。 轻 林 技 卵 , 海 河 炳 简 单 , 抖 分 不 贺 力 , 易 法 年 葛 洗 + +。 宝 居 电 机 支 林 , 稿 国 刹 闹 , 金 居 淅 轶 村 , 相 命 长 , 里 租 音 +。 120V 息 压 , 免 诊 贺 选 坤 加 孩 大 埃 内 + +。 症 出 真 着 2 中 文 说 用 书 资 文 议 甫 diff --git a/class2/Tesseract/chi_image.png b/class2/Tesseract/chi_image.png new file mode 100644 index 0000000..d24fc54 Binary files /dev/null and b/class2/Tesseract/chi_image.png differ diff --git a/class2/Tesseract/learner-profile-en.pdf b/class2/Tesseract/learner-profile-en.pdf new file mode 100644 index 0000000..ad88c7b Binary files /dev/null and b/class2/Tesseract/learner-profile-en.pdf differ diff --git a/class2/Tesseract/output.txt.txt b/class2/Tesseract/output.txt.txt new file mode 100644 index 0000000..c617cc1 --- /dev/null +++ b/class2/Tesseract/output.txt.txt @@ -0,0 +1,75 @@ +IB learner profile + +The aim of all IB programmes is to develop internationally minded people who, recognizing their +common humanity and shared guardianship of the planet, help to create a better and more peaceful world. + +As IB learners we strive to be: + +INQUIRERS + +We nurture our curiosity, developing skils for inquiry and +research, We know how to leam independently and with others. +We learn with enthusiasm and sustain our love of learning +throughout ife. + +KNOWLEDGEABLE + +We develop and use conceptual understanding, exploring +knowledge across a range of disciplines We engage with issues +and ideas that have local and global significance. + +THINKERS + +We use critical and creative thinking skill to analyse and take +responsible action on complex problems. We exercise initiative in +making reasoned, ethical decisions. + +COMMUNICATORS + +We express ourselves confidently and creatively in more than +onelanguage and in many ways. We collaborate effectively, +listening carefully to the perspectives of other individuals and +groups. + +PRINCIPLED + +We act with integrity and honesty, with a strong sense of fairness +and justice, and with respect for the dignity and rights of people +everywhere. We take responsibility for our actions and their +consequences. + +OPEN-MINDED + +We artically appreciate our own cultures and personal histories, as +wellas the values and traditions of others. We seek and evaluate a +range of points of view, and we are wiling to grow from the +experience. + +CARING + +We show empathy, compassion and respect. We have a +commitment to service, and we act to make a positive difference +inthe lives of others and in the world around us. + +RISK-TAKERS + +We approach uncertainty with forethoughtand determination; +wework independently and cooperatively to explore new ideas +and innovative strategies. We are resourceful and resiient in the +face of challenges and change. + +BALANCED + +We understand the importance of balancing different aspects of +our lives—intellectual, physical, and emotional—toachieve +wellbeing for ourselves and others We recognize our interdependence +with other people and with the world in which we live. + +REFLECTIVE + +We thoughtfully consider the world and our own ideas and +experience. We work to understand our strengths and weaknesses +in order o support our learning and personal development. + +The IB learner profile represents 10 attributes valued by IB World Schools. We believe these attributes, and others like +them, can help individuals and groups become responsible members of local, national and global communities. diff --git a/class2/Tesseract/pytesseract_image.ipynb b/class2/Tesseract/pytesseract_image.ipynb new file mode 100644 index 0000000..ad2a9d2 --- /dev/null +++ b/class2/Tesseract/pytesseract_image.ipynb @@ -0,0 +1,128 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "1115a639", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IB learner profile\n", + "\n", + "The aim of all IB programmes is to develop internationally minded people who, recognizing their\n", + "common humanity and shared guardianship of the planet, help to create a better and more peaceful world.\n", + "\n", + "As IB learners we strive to be:\n", + "\n", + "INQUIRERS\n", + "\n", + "We nurture our curiosity, developing skils for inquiry and\n", + "research, We know how to leam independently and with others.\n", + "We learn with enthusiasm and sustain our love of learning\n", + "throughout ife.\n", + "\n", + "KNOWLEDGEABLE\n", + "\n", + "We develop and use conceptual understanding, exploring\n", + "knowledge across a range of disciplines We engage with issues\n", + "and ideas that have local and global significance.\n", + "\n", + "THINKERS\n", + "\n", + "We use critical and creative thinking skill to analyse and take\n", + "responsible action on complex problems. We exercise initiative in\n", + "making reasoned, ethical decisions.\n", + "\n", + "COMMUNICATORS\n", + "\n", + "We express ourselves confidently and creatively in more than\n", + "onelanguage and in many ways. We collaborate effectively,\n", + "listening carefully to the perspectives of other individuals and\n", + "groups.\n", + "\n", + "PRINCIPLED\n", + "\n", + "We act with integrity and honesty, with a strong sense of fairness\n", + "and justice, and with respect for the dignity and rights of people\n", + "everywhere. We take responsibility for our actions and their\n", + "consequences.\n", + "\n", + "OPEN-MINDED\n", + "\n", + "We artically appreciate our own cultures and personal histories, as\n", + "wellas the values and traditions of others. We seek and evaluate a\n", + "range of points of view, and we are wiling to grow from the\n", + "experience.\n", + "\n", + "CARING\n", + "\n", + "We show empathy, compassion and respect. We have a\n", + "commitment to service, and we act to make a positive difference\n", + "inthe lives of others and in the world around us.\n", + "\n", + "RISK-TAKERS\n", + "\n", + "We approach uncertainty with forethoughtand determination;\n", + "wework independently and cooperatively to explore new ideas\n", + "and innovative strategies. We are resourceful and resiient in the\n", + "face of challenges and change.\n", + "\n", + "BALANCED\n", + "\n", + "We understand the importance of balancing different aspects of\n", + "our lives—intellectual, physical, and emotional—toachieve\n", + "wellbeing for ourselves and others We recognize our interdependence\n", + "with other people and with the world in which we live.\n", + "\n", + "REFLECTIVE\n", + "\n", + "We thoughtfully consider the world and our own ideas and\n", + "experience. We work to understand our strengths and weaknesses\n", + "in order o support our learning and personal development.\n", + "\n", + "The IB learner profile represents 10 attributes valued by IB World Schools. We believe these attributes, and others like\n", + "them, can help individuals and groups become responsible members of local, national and global communities.\n", + "\n" + ] + } + ], + "source": [ + "\n", + "from PIL import Image #pip install Pillow\n", + "import pytesseract #pip install pytesseract\n", + "\n", + "# Load an image using Pillow (PIL)\n", + "image = Image.open('IB_learner_profile.png')\n", + "\n", + "# Perform OCR on the image\n", + "text = pytesseract.image_to_string(image)\n", + "\n", + "print(text)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/class2/langChain/Attention_Transformers.ipynb b/class2/langChain/Attention_Transformers.ipynb new file mode 100644 index 0000000..d49f5b7 --- /dev/null +++ b/class2/langChain/Attention_Transformers.ipynb @@ -0,0 +1,327 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "id": "0615974b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Defaulting to user installation because normal site-packages is not writeable\n", + "Requirement already satisfied: numpy in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (2.3.4)\n", + "Requirement already satisfied: torch in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (2.9.0)\n", + "Requirement already satisfied: transformers in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (4.57.1)\n", + "Requirement already satisfied: huggingface_hub in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (0.36.0)\n", + "Requirement already satisfied: filelock in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (3.20.0)\n", + "Requirement already satisfied: typing-extensions>=4.10.0 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (4.15.0)\n", + "Requirement already satisfied: sympy>=1.13.3 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (1.14.0)\n", + "Requirement already satisfied: networkx>=2.5.1 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (3.5)\n", + "Requirement already satisfied: jinja2 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (3.1.6)\n", + "Requirement already satisfied: fsspec>=0.8.5 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (2025.10.0)\n", + "Requirement already satisfied: setuptools in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from torch) (80.9.0)\n", + "Requirement already satisfied: packaging>=20.0 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (25.0)\n", + "Requirement already satisfied: pyyaml>=5.1 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (6.0.3)\n", + "Requirement already satisfied: regex!=2019.12.17 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (2025.11.3)\n", + "Requirement already satisfied: requests in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (2.32.5)\n", + "Requirement already satisfied: tokenizers<=0.23.0,>=0.22.0 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (0.22.1)\n", + "Requirement already satisfied: safetensors>=0.4.3 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (0.6.2)\n", + "Requirement already satisfied: tqdm>=4.27 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from transformers) (4.67.1)\n", + "Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from sympy>=1.13.3->torch) (1.3.0)\n", + "Requirement already satisfied: colorama in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from tqdm>=4.27->transformers) (0.4.6)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from jinja2->torch) (3.0.3)\n", + "Requirement already satisfied: charset_normalizer<4,>=2 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from requests->transformers) (3.4.4)\n", + "Requirement already satisfied: idna<4,>=2.5 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from requests->transformers) (3.11)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from requests->transformers) (2.5.0)\n", + "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\keanu\\appdata\\roaming\\python\\python314\\site-packages (from requests->transformers) (2025.10.5)\n", + "\u001b[1;34musage: \u001b[0m\u001b[35mhuggingface-cli []\u001b[0m\n", + "\n", + "\u001b[1;34mpositional arguments:\u001b[0m\n", + " \u001b[1;32m{download,upload,repo-files,env,login,whoami,logout,auth,repo,lfs-enable-largefiles,lfs-multipart-upload,scan-cache,delete-cache,tag,version,upload-large-folder}\u001b[0m\n", + " huggingface-cli command helpers\n", + " \u001b[1;32mdownload\u001b[0m Download files from the Hub\n", + " \u001b[1;32mupload\u001b[0m Upload a file or a folder to a repo on the Hub\n", + " \u001b[1;32mrepo-files\u001b[0m Manage files in a repo on the Hub\n", + " \u001b[1;32menv\u001b[0m Print information about the environment.\n", + " \u001b[1;32mlogin\u001b[0m Log in using a token from\n", + " huggingface.co/settings/tokens\n", + " \u001b[1;32mwhoami\u001b[0m Find out which huggingface.co account you are logged\n", + " in as.\n", + " \u001b[1;32mlogout\u001b[0m Log out\n", + " \u001b[1;32mauth\u001b[0m Other authentication related commands\n", + " \u001b[1;32mrepo\u001b[0m {create} Commands to interact with your huggingface.co\n", + " repos.\n", + " \u001b[1;32mlfs-enable-largefiles\u001b[0m\n", + " Configure your repository to enable upload of files >\n", + " 5GB.\n", + " \u001b[1;32mscan-cache\u001b[0m Scan cache directory.\n", + " \u001b[1;32mdelete-cache\u001b[0m Delete revisions from the cache directory.\n", + " \u001b[1;32mtag\u001b[0m (create, list, delete) tags for a repo in the hub\n", + " \u001b[1;32mversion\u001b[0m Print information about the huggingface-cli version.\n", + " \u001b[1;32mupload-large-folder\u001b[0m\n", + " Upload a large folder to a repo on the Hub\n", + "\n", + "\u001b[1;34moptions:\u001b[0m\n", + " \u001b[1;32m-h\u001b[0m, \u001b[1;36m--help\u001b[0m show this help message and exit\n" + ] + } + ], + "source": [ + "\n", + "! pip install numpy torch transformers huggingface_hub\n", + "\n", + "# For `huggingface-cli`, it is included with `huggingface_hub` or `transformers`. You can check your installation with:\n", + "\n", + "! huggingface-cli --help" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "38aee673", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Attention Output:\n", + " [[0.3941621 0.66508081 0.70495899 0.66115133 0.7331667 0.50954459\n", + " 0.5395512 0.52301811]\n", + " [0.39778232 0.67018384 0.7040866 0.65956355 0.72499916 0.51091545\n", + " 0.54087236 0.52987163]\n", + " [0.41231846 0.66929663 0.70214592 0.64984714 0.7082042 0.53475899\n", + " 0.52649881 0.53193518]\n", + " [0.4046827 0.66867854 0.70327713 0.65383317 0.72324104 0.52670896\n", + " 0.53503292 0.5318858 ]]\n", + "Attention Weights:\n", + " [[0.22111475 0.25881178 0.25839165 0.26168182]\n", + " [0.20728441 0.24929883 0.26927944 0.27413732]\n", + " [0.21930221 0.20852097 0.29300466 0.27917216]\n", + " [0.22146896 0.22777526 0.2731889 0.27756687]]\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "\n", + "# Random Q, K, V matrices\n", + "def generate_random_qkv(seq_len=4, d_model=8):\n", + " return [np.random.rand(seq_len, d_model) for _ in range(3)]\n", + "\n", + "# Scaled dot-product attention\n", + "def self_attention(Q, K, V):\n", + " d_k = Q.shape[-1]\n", + " scores = np.dot(Q, K.T) / np.sqrt(d_k)\n", + " weights = softmax(scores)\n", + " output = np.dot(weights, V)\n", + " return output, weights\n", + "\n", + "def softmax(x):\n", + " exp_x = np.exp(x - np.max(x, axis=-1, keepdims=True))\n", + " return exp_x / np.sum(exp_x, axis=-1, keepdims=True)\n", + "\n", + "Q, K, V = generate_random_qkv()\n", + "out, attn_weights = self_attention(Q, K, V)\n", + "print(\"Attention Output:\\n\", out)\n", + "print(\"Attention Weights:\\n\", attn_weights)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "8e50f33c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "torch.Size([1, 5, 16])\n" + ] + } + ], + "source": [ + "import torch\n", + "import torch.nn as nn\n", + "\n", + "class MiniTransformerBlock(nn.Module):\n", + " def __init__(self, embed_dim):\n", + " super().__init__()\n", + " self.attn = nn.MultiheadAttention(embed_dim, num_heads=2, batch_first=True)\n", + " self.ffn = nn.Sequential(\n", + " nn.Linear(embed_dim, embed_dim * 4),\n", + " nn.ReLU(),\n", + " nn.Linear(embed_dim * 4, embed_dim)\n", + " )\n", + " self.norm1 = nn.LayerNorm(embed_dim)\n", + " self.norm2 = nn.LayerNorm(embed_dim)\n", + " \n", + " def forward(self, x):\n", + " attn_output, _ = self.attn(x, x, x)\n", + " x = self.norm1(x + attn_output)\n", + " ffn_output = self.ffn(x)\n", + " x = self.norm2(x + ffn_output)\n", + " return x\n", + "\n", + "x = torch.randn(1, 5, 16) # batch_size=1, seq_len=5, embed_dim=16\n", + "model = MiniTransformerBlock(embed_dim=16)\n", + "out = model(x)\n", + "print(out.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ecb6021e", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Note: Environment variable`HF_TOKEN` is set and is the current active token independently from the token you've just configured.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Using device: cpu\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c4bf310007134d65a39c02b2aa609832", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "tokenizer.model: 0%| | 0.00/493k [00:00 \u001b[39m\u001b[32m479\u001b[39m \u001b[43mhf_hub_download\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 480\u001b[39m \u001b[43m \u001b[49m\u001b[43mpath_or_repo_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 481\u001b[39m \u001b[43m \u001b[49m\u001b[43mfilenames\u001b[49m\u001b[43m[\u001b[49m\u001b[32;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 482\u001b[39m \u001b[43m \u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[43m==\u001b[49m\u001b[43m \u001b[49m\u001b[32;43m0\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 483\u001b[39m \u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 484\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 485\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 486\u001b[39m \u001b[43m \u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m=\u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 487\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 488\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 489\u001b[39m \u001b[43m \u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 490\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 491\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 492\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 493\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\_validators.py:106\u001b[39m, in \u001b[36mvalidate_hf_hub_args.._inner_fn\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 105\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m arg_name \u001b[38;5;129;01min\u001b[39;00m [\u001b[33m\"\u001b[39m\u001b[33mrepo_id\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mfrom_id\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mto_id\u001b[39m\u001b[33m\"\u001b[39m]:\n\u001b[32m--> \u001b[39m\u001b[32m106\u001b[39m \u001b[43mvalidate_repo_id\u001b[49m\u001b[43m(\u001b[49m\u001b[43marg_value\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 108\u001b[39m \u001b[38;5;28;01melif\u001b[39;00m arg_name == \u001b[33m\"\u001b[39m\u001b[33mtoken\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m arg_value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\_validators.py:160\u001b[39m, in \u001b[36mvalidate_repo_id\u001b[39m\u001b[34m(repo_id)\u001b[39m\n\u001b[32m 159\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m REPO_ID_REGEX.match(repo_id):\n\u001b[32m--> \u001b[39m\u001b[32m160\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m HFValidationError(\n\u001b[32m 161\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mRepo id must use alphanumeric chars, \u001b[39m\u001b[33m'\u001b[39m\u001b[33m-\u001b[39m\u001b[33m'\u001b[39m\u001b[33m, \u001b[39m\u001b[33m'\u001b[39m\u001b[33m_\u001b[39m\u001b[33m'\u001b[39m\u001b[33m or \u001b[39m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 162\u001b[39m \u001b[33m\"\u001b[39m\u001b[33m The name cannot start or end with \u001b[39m\u001b[33m'\u001b[39m\u001b[33m-\u001b[39m\u001b[33m'\u001b[39m\u001b[33m or \u001b[39m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m'\u001b[39m\u001b[33m and the maximum length is 96:\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 163\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrepo_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 164\u001b[39m )\n\u001b[32m 166\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[33m\"\u001b[39m\u001b[33m--\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m repo_id \u001b[38;5;129;01mor\u001b[39;00m \u001b[33m\"\u001b[39m\u001b[33m..\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m repo_id:\n", + "\u001b[31mHFValidationError\u001b[39m: Repo id must use alphanumeric chars, '-', '_' or '.'. The name cannot start or end with '-' or '.' and the maximum length is 96: 'meta-llama/Llama-3.1-8B-Instruct:novita'.", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[31mHFValidationError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[13]\u001b[39m\u001b[32m, line 4\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;66;03m# Use a pipeline as a high-level helper\u001b[39;00m\n\u001b[32m 2\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mtransformers\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m pipeline\n\u001b[32m----> \u001b[39m\u001b[32m4\u001b[39m pipe = \u001b[43mpipeline\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtext-generation\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodel\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mmeta-llama/Llama-3.1-8B-Instruct:novita\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m#,meta-llama/Llama-3.1-8B-Instruct\u001b[39;00m\n\u001b[32m 5\u001b[39m messages = [\n\u001b[32m 6\u001b[39m {\u001b[33m\"\u001b[39m\u001b[33mrole\u001b[39m\u001b[33m\"\u001b[39m: \u001b[33m\"\u001b[39m\u001b[33muser\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mcontent\u001b[39m\u001b[33m\"\u001b[39m: \u001b[33m\"\u001b[39m\u001b[33mWhere is the forbidden city?\u001b[39m\u001b[33m\"\u001b[39m},\n\u001b[32m 7\u001b[39m ]\n\u001b[32m 8\u001b[39m pipe(messages)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\pipelines\\__init__.py:883\u001b[39m, in \u001b[36mpipeline\u001b[39m\u001b[34m(task, model, config, tokenizer, feature_extractor, image_processor, processor, framework, revision, use_fast, token, device, device_map, dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)\u001b[39m\n\u001b[32m 879\u001b[39m pretrained_model_name_or_path = model\n\u001b[32m 881\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(config, PretrainedConfig) \u001b[38;5;129;01mand\u001b[39;00m pretrained_model_name_or_path \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 882\u001b[39m \u001b[38;5;66;03m# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m883\u001b[39m resolved_config_file = \u001b[43mcached_file\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 884\u001b[39m \u001b[43m \u001b[49m\u001b[43mpretrained_model_name_or_path\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 885\u001b[39m \u001b[43m \u001b[49m\u001b[43mCONFIG_NAME\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 886\u001b[39m \u001b[43m \u001b[49m\u001b[43m_raise_exceptions_for_gated_repo\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 887\u001b[39m \u001b[43m \u001b[49m\u001b[43m_raise_exceptions_for_missing_entries\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 888\u001b[39m \u001b[43m \u001b[49m\u001b[43m_raise_exceptions_for_connection_errors\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 889\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmodel_kwargs\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mcache_dir\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 890\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mhub_kwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 891\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 892\u001b[39m hub_kwargs[\u001b[33m\"\u001b[39m\u001b[33m_commit_hash\u001b[39m\u001b[33m\"\u001b[39m] = extract_commit_hash(resolved_config_file, commit_hash)\n\u001b[32m 893\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\utils\\hub.py:322\u001b[39m, in \u001b[36mcached_file\u001b[39m\u001b[34m(path_or_repo_id, filename, **kwargs)\u001b[39m\n\u001b[32m 264\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mcached_file\u001b[39m(\n\u001b[32m 265\u001b[39m path_or_repo_id: Union[\u001b[38;5;28mstr\u001b[39m, os.PathLike],\n\u001b[32m 266\u001b[39m filename: \u001b[38;5;28mstr\u001b[39m,\n\u001b[32m 267\u001b[39m **kwargs,\n\u001b[32m 268\u001b[39m ) -> Optional[\u001b[38;5;28mstr\u001b[39m]:\n\u001b[32m 269\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m 270\u001b[39m \u001b[33;03m Tries to locate a file in a local folder and repo, downloads and cache it if necessary.\u001b[39;00m\n\u001b[32m 271\u001b[39m \n\u001b[32m (...)\u001b[39m\u001b[32m 320\u001b[39m \u001b[33;03m ```\u001b[39;00m\n\u001b[32m 321\u001b[39m \u001b[33;03m \"\"\"\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m322\u001b[39m file = \u001b[43mcached_files\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpath_or_repo_id\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpath_or_repo_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilenames\u001b[49m\u001b[43m=\u001b[49m\u001b[43m[\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 323\u001b[39m file = file[\u001b[32m0\u001b[39m] \u001b[38;5;28;01mif\u001b[39;00m file \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m file\n\u001b[32m 324\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m file\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\utils\\hub.py:532\u001b[39m, in \u001b[36mcached_files\u001b[39m\u001b[34m(path_or_repo_id, filenames, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)\u001b[39m\n\u001b[32m 524\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m(\n\u001b[32m 525\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mPermissionError at \u001b[39m\u001b[38;5;132;01m{\u001b[39;00me.filename\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m when downloading \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mpath_or_repo_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m. \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 526\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mCheck cache directory permissions. Common causes: 1) another user is downloading the same model (please wait); \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 527\u001b[39m \u001b[33m\"\u001b[39m\u001b[33m2) a previous download was canceled and the lock file needs manual removal.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 528\u001b[39m ) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01me\u001b[39;00m\n\u001b[32m 530\u001b[39m \u001b[38;5;66;03m# Now we try to recover if we can find all files correctly in the cache\u001b[39;00m\n\u001b[32m 531\u001b[39m resolved_files = [\n\u001b[32m--> \u001b[39m\u001b[32m532\u001b[39m \u001b[43m_get_cache_file_to_return\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpath_or_repo_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 533\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m filename \u001b[38;5;129;01min\u001b[39;00m full_filenames\n\u001b[32m 534\u001b[39m ]\n\u001b[32m 535\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mall\u001b[39m(file \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01mfor\u001b[39;00m file \u001b[38;5;129;01min\u001b[39;00m resolved_files):\n\u001b[32m 536\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m resolved_files\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\utils\\hub.py:143\u001b[39m, in \u001b[36m_get_cache_file_to_return\u001b[39m\u001b[34m(path_or_repo_id, full_filename, cache_dir, revision, repo_type)\u001b[39m\n\u001b[32m 135\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_get_cache_file_to_return\u001b[39m(\n\u001b[32m 136\u001b[39m path_or_repo_id: \u001b[38;5;28mstr\u001b[39m,\n\u001b[32m 137\u001b[39m full_filename: \u001b[38;5;28mstr\u001b[39m,\n\u001b[32m (...)\u001b[39m\u001b[32m 141\u001b[39m ):\n\u001b[32m 142\u001b[39m \u001b[38;5;66;03m# We try to see if we have a cached version (not up to date):\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m143\u001b[39m resolved_file = \u001b[43mtry_to_load_from_cache\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 144\u001b[39m \u001b[43m \u001b[49m\u001b[43mpath_or_repo_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfull_filename\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_type\u001b[49m\n\u001b[32m 145\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 146\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m resolved_file \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m resolved_file != _CACHED_NO_EXIST:\n\u001b[32m 147\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m resolved_file\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\_validators.py:106\u001b[39m, in \u001b[36mvalidate_hf_hub_args.._inner_fn\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 101\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m arg_name, arg_value \u001b[38;5;129;01min\u001b[39;00m chain(\n\u001b[32m 102\u001b[39m \u001b[38;5;28mzip\u001b[39m(signature.parameters, args), \u001b[38;5;66;03m# Args values\u001b[39;00m\n\u001b[32m 103\u001b[39m kwargs.items(), \u001b[38;5;66;03m# Kwargs values\u001b[39;00m\n\u001b[32m 104\u001b[39m ):\n\u001b[32m 105\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m arg_name \u001b[38;5;129;01min\u001b[39;00m [\u001b[33m\"\u001b[39m\u001b[33mrepo_id\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mfrom_id\u001b[39m\u001b[33m\"\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mto_id\u001b[39m\u001b[33m\"\u001b[39m]:\n\u001b[32m--> \u001b[39m\u001b[32m106\u001b[39m \u001b[43mvalidate_repo_id\u001b[49m\u001b[43m(\u001b[49m\u001b[43marg_value\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 108\u001b[39m \u001b[38;5;28;01melif\u001b[39;00m arg_name == \u001b[33m\"\u001b[39m\u001b[33mtoken\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m arg_value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 109\u001b[39m has_token = \u001b[38;5;28;01mTrue\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\_validators.py:160\u001b[39m, in \u001b[36mvalidate_repo_id\u001b[39m\u001b[34m(repo_id)\u001b[39m\n\u001b[32m 154\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m HFValidationError(\n\u001b[32m 155\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mRepo id must be in the form \u001b[39m\u001b[33m'\u001b[39m\u001b[33mrepo_name\u001b[39m\u001b[33m'\u001b[39m\u001b[33m or \u001b[39m\u001b[33m'\u001b[39m\u001b[33mnamespace/repo_name\u001b[39m\u001b[33m'\u001b[39m\u001b[33m:\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 156\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrepo_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m. Use `repo_type` argument if needed.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 157\u001b[39m )\n\u001b[32m 159\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m REPO_ID_REGEX.match(repo_id):\n\u001b[32m--> \u001b[39m\u001b[32m160\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m HFValidationError(\n\u001b[32m 161\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mRepo id must use alphanumeric chars, \u001b[39m\u001b[33m'\u001b[39m\u001b[33m-\u001b[39m\u001b[33m'\u001b[39m\u001b[33m, \u001b[39m\u001b[33m'\u001b[39m\u001b[33m_\u001b[39m\u001b[33m'\u001b[39m\u001b[33m or \u001b[39m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 162\u001b[39m \u001b[33m\"\u001b[39m\u001b[33m The name cannot start or end with \u001b[39m\u001b[33m'\u001b[39m\u001b[33m-\u001b[39m\u001b[33m'\u001b[39m\u001b[33m or \u001b[39m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m'\u001b[39m\u001b[33m and the maximum length is 96:\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 163\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrepo_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 164\u001b[39m )\n\u001b[32m 166\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[33m\"\u001b[39m\u001b[33m--\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m repo_id \u001b[38;5;129;01mor\u001b[39;00m \u001b[33m\"\u001b[39m\u001b[33m..\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m repo_id:\n\u001b[32m 167\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m HFValidationError(\u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mCannot have -- or .. in repo_id: \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrepo_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m.\u001b[39m\u001b[33m\"\u001b[39m)\n", + "\u001b[31mHFValidationError\u001b[39m: Repo id must use alphanumeric chars, '-', '_' or '.'. The name cannot start or end with '-' or '.' and the maximum length is 96: 'meta-llama/Llama-3.1-8B-Instruct:novita'." + ] + } + ], + "source": [ + "# Use a pipeline as a high-level helper\n", + "from transformers import pipeline\n", + "\n", + "pipe = pipeline(\"text-generation\", model=\"meta-llama/Llama-3.1-8B-Instruct\") #,meta-llama/Llama-3.1-8B-Instruct\n", + "messages = [\n", + " {\"role\": \"user\", \"content\": \"Where is the forbidden city?\"},\n", + "]\n", + "pipe(messages)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9672d2b4", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2c296acba80543fa8341f350fcc4e742", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Fetching 4 files: 0%| | 0/4 [00:00", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mKeyError\u001b[39m Traceback (most recent call last)", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\traitlets\\traitlets.py:632\u001b[39m, in \u001b[36mTraitType.get\u001b[39m\u001b[34m(self, obj, cls)\u001b[39m\n\u001b[32m 631\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m632\u001b[39m value = \u001b[43mobj\u001b[49m\u001b[43m.\u001b[49m\u001b[43m_trait_values\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mname\u001b[49m\u001b[43m]\u001b[49m\n\u001b[32m 633\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m:\n\u001b[32m 634\u001b[39m \u001b[38;5;66;03m# Check for a dynamic initializer.\u001b[39;00m\n", + "\u001b[31mKeyError\u001b[39m: 'layout'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[31mLookupError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 9\u001b[39m\n\u001b[32m 7\u001b[39m model_id = \u001b[33m\"\u001b[39m\u001b[33mmeta-llama/Meta-Llama-3.1-8B-Instruct\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 8\u001b[39m tokenizer = AutoTokenizer.from_pretrained(model_id) \n\u001b[32m----> \u001b[39m\u001b[32m9\u001b[39m model = \u001b[43mAutoModelForCausalLM\u001b[49m\u001b[43m.\u001b[49m\u001b[43mfrom_pretrained\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmodel_id\u001b[49m\u001b[43m)\u001b[49m \n\u001b[32m 11\u001b[39m prompt = \u001b[33m\"\u001b[39m\u001b[33mThe Eiffel Tower is located in\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 12\u001b[39m inputs = tokenizer(prompt, return_tensors=\u001b[33m\"\u001b[39m\u001b[33mpt\u001b[39m\u001b[33m\"\u001b[39m)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\models\\auto\\auto_factory.py:604\u001b[39m, in \u001b[36m_BaseAutoModelClass.from_pretrained\u001b[39m\u001b[34m(cls, pretrained_model_name_or_path, *model_args, **kwargs)\u001b[39m\n\u001b[32m 602\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m model_class.config_class == config.sub_configs.get(\u001b[33m\"\u001b[39m\u001b[33mtext_config\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[32m 603\u001b[39m config = config.get_text_config()\n\u001b[32m--> \u001b[39m\u001b[32m604\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mmodel_class\u001b[49m\u001b[43m.\u001b[49m\u001b[43mfrom_pretrained\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 605\u001b[39m \u001b[43m \u001b[49m\u001b[43mpretrained_model_name_or_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43mmodel_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m=\u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mhub_kwargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\n\u001b[32m 606\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 607\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[32m 608\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mUnrecognized configuration class \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mconfig.\u001b[34m__class__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m for this kind of AutoModel: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mcls\u001b[39m.\u001b[34m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m.\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[33m\"\u001b[39m\n\u001b[32m 609\u001b[39m \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mModel type should be one of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m, \u001b[39m\u001b[33m'\u001b[39m.join(c.\u001b[34m__name__\u001b[39m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mfor\u001b[39;00m\u001b[38;5;250m \u001b[39mc\u001b[38;5;250m \u001b[39m\u001b[38;5;129;01min\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28mcls\u001b[39m._model_mapping)\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 610\u001b[39m )\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\modeling_utils.py:277\u001b[39m, in \u001b[36mrestore_default_dtype.._wrapper\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 275\u001b[39m old_dtype = torch.get_default_dtype()\n\u001b[32m 276\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m277\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 278\u001b[39m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[32m 279\u001b[39m torch.set_default_dtype(old_dtype)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\modeling_utils.py:4900\u001b[39m, in \u001b[36mPreTrainedModel.from_pretrained\u001b[39m\u001b[34m(cls, pretrained_model_name_or_path, config, cache_dir, ignore_mismatched_sizes, force_download, local_files_only, token, revision, use_safetensors, weights_only, *model_args, **kwargs)\u001b[39m\n\u001b[32m 4890\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[32m 4891\u001b[39m gguf_file\n\u001b[32m 4892\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m device_map \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 4893\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m ((\u001b[38;5;28misinstance\u001b[39m(device_map, \u001b[38;5;28mdict\u001b[39m) \u001b[38;5;129;01mand\u001b[39;00m \u001b[33m\"\u001b[39m\u001b[33mdisk\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m device_map.values()) \u001b[38;5;129;01mor\u001b[39;00m \u001b[33m\"\u001b[39m\u001b[33mdisk\u001b[39m\u001b[33m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m device_map)\n\u001b[32m 4894\u001b[39m ):\n\u001b[32m 4895\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[32m 4896\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mOne or more modules is configured to be mapped to disk. Disk offload is not supported for models \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 4897\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mloaded from GGUF files.\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 4898\u001b[39m )\n\u001b[32m-> \u001b[39m\u001b[32m4900\u001b[39m checkpoint_files, sharded_metadata = \u001b[43m_get_resolved_checkpoint_files\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 4901\u001b[39m \u001b[43m \u001b[49m\u001b[43mpretrained_model_name_or_path\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpretrained_model_name_or_path\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4902\u001b[39m \u001b[43m \u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m=\u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4903\u001b[39m \u001b[43m \u001b[49m\u001b[43mvariant\u001b[49m\u001b[43m=\u001b[49m\u001b[43mvariant\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4904\u001b[39m \u001b[43m \u001b[49m\u001b[43mgguf_file\u001b[49m\u001b[43m=\u001b[49m\u001b[43mgguf_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4905\u001b[39m \u001b[43m \u001b[49m\u001b[43mfrom_tf\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfrom_tf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4906\u001b[39m \u001b[43m \u001b[49m\u001b[43mfrom_flax\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfrom_flax\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4907\u001b[39m \u001b[43m \u001b[49m\u001b[43muse_safetensors\u001b[49m\u001b[43m=\u001b[49m\u001b[43muse_safetensors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4908\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4909\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4910\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4911\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4912\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4913\u001b[39m \u001b[43m \u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m=\u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4914\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4915\u001b[39m \u001b[43m \u001b[49m\u001b[43mcommit_hash\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcommit_hash\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4916\u001b[39m \u001b[43m \u001b[49m\u001b[43mis_remote_code\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mcls\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_auto_class\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 4917\u001b[39m \u001b[43m \u001b[49m\u001b[43mtransformers_explicit_filename\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtransformers_explicit_filename\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 4918\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 4920\u001b[39m is_sharded = sharded_metadata \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 4921\u001b[39m is_quantized = hf_quantizer \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\modeling_utils.py:1200\u001b[39m, in \u001b[36m_get_resolved_checkpoint_files\u001b[39m\u001b[34m(pretrained_model_name_or_path, subfolder, variant, gguf_file, from_tf, from_flax, use_safetensors, cache_dir, force_download, proxies, local_files_only, token, user_agent, revision, commit_hash, is_remote_code, transformers_explicit_filename)\u001b[39m\n\u001b[32m 1198\u001b[39m sharded_metadata = \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 1199\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m is_sharded:\n\u001b[32m-> \u001b[39m\u001b[32m1200\u001b[39m checkpoint_files, sharded_metadata = \u001b[43mget_checkpoint_shard_files\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1201\u001b[39m \u001b[43m \u001b[49m\u001b[43mpretrained_model_name_or_path\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1202\u001b[39m \u001b[43m \u001b[49m\u001b[43mresolved_archive_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1203\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1204\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1205\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1206\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1207\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1208\u001b[39m \u001b[43m \u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m=\u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1209\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1210\u001b[39m \u001b[43m \u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m=\u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1211\u001b[39m \u001b[43m \u001b[49m\u001b[43m_commit_hash\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcommit_hash\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1212\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1213\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1214\u001b[39m checkpoint_files = [resolved_archive_file] \u001b[38;5;28;01mif\u001b[39;00m pretrained_model_name_or_path \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\utils\\hub.py:1084\u001b[39m, in \u001b[36mget_checkpoint_shard_files\u001b[39m\u001b[34m(pretrained_model_name_or_path, index_filename, cache_dir, force_download, proxies, resume_download, local_files_only, token, user_agent, revision, subfolder, _commit_hash, **deprecated_kwargs)\u001b[39m\n\u001b[32m 1080\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m shard_filenames, sharded_metadata\n\u001b[32m 1082\u001b[39m \u001b[38;5;66;03m# At this stage pretrained_model_name_or_path is a model identifier on the Hub. Try to get everything from cache,\u001b[39;00m\n\u001b[32m 1083\u001b[39m \u001b[38;5;66;03m# or download the files\u001b[39;00m\n\u001b[32m-> \u001b[39m\u001b[32m1084\u001b[39m cached_filenames = \u001b[43mcached_files\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1085\u001b[39m \u001b[43m \u001b[49m\u001b[43mpretrained_model_name_or_path\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1086\u001b[39m \u001b[43m \u001b[49m\u001b[43mshard_filenames\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1087\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1088\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1089\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1090\u001b[39m \u001b[43m \u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1091\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1092\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1093\u001b[39m \u001b[43m \u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m=\u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1094\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1095\u001b[39m \u001b[43m \u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m=\u001b[49m\u001b[43msubfolder\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1096\u001b[39m \u001b[43m \u001b[49m\u001b[43m_commit_hash\u001b[49m\u001b[43m=\u001b[49m\u001b[43m_commit_hash\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1097\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1099\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m cached_filenames, sharded_metadata\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\utils\\hub.py:567\u001b[39m, in \u001b[36mcached_files\u001b[39m\u001b[34m(path_or_repo_id, filenames, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)\u001b[39m\n\u001b[32m 564\u001b[39m \u001b[38;5;66;03m# Any other Exception type should now be re-raised, in order to provide helpful error messages and break the execution flow\u001b[39;00m\n\u001b[32m 565\u001b[39m \u001b[38;5;66;03m# (EntryNotFoundError will be treated outside this block and correctly re-raised if needed)\u001b[39;00m\n\u001b[32m 566\u001b[39m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e, EntryNotFoundError):\n\u001b[32m--> \u001b[39m\u001b[32m567\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[32m 569\u001b[39m resolved_files = [\n\u001b[32m 570\u001b[39m _get_cache_file_to_return(path_or_repo_id, filename, cache_dir, revision) \u001b[38;5;28;01mfor\u001b[39;00m filename \u001b[38;5;129;01min\u001b[39;00m full_filenames\n\u001b[32m 571\u001b[39m ]\n\u001b[32m 572\u001b[39m \u001b[38;5;66;03m# If there are any missing file and the flag is active, raise\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\transformers\\utils\\hub.py:494\u001b[39m, in \u001b[36mcached_files\u001b[39m\u001b[34m(path_or_repo_id, filenames, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)\u001b[39m\n\u001b[32m 479\u001b[39m hf_hub_download(\n\u001b[32m 480\u001b[39m path_or_repo_id,\n\u001b[32m 481\u001b[39m filenames[\u001b[32m0\u001b[39m],\n\u001b[32m (...)\u001b[39m\u001b[32m 491\u001b[39m local_files_only=local_files_only,\n\u001b[32m 492\u001b[39m )\n\u001b[32m 493\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m494\u001b[39m \u001b[43msnapshot_download\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 495\u001b[39m \u001b[43m \u001b[49m\u001b[43mpath_or_repo_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 496\u001b[39m \u001b[43m \u001b[49m\u001b[43mallow_patterns\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfull_filenames\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 497\u001b[39m \u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 498\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 499\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 500\u001b[39m \u001b[43m \u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m=\u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 501\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 502\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 503\u001b[39m \u001b[43m \u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 504\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 505\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 506\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 508\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[32m 509\u001b[39m \u001b[38;5;66;03m# We cannot recover from them\u001b[39;00m\n\u001b[32m 510\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e, RepositoryNotFoundError) \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e, GatedRepoError):\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\_validators.py:114\u001b[39m, in \u001b[36mvalidate_hf_hub_args.._inner_fn\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 111\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m check_use_auth_token:\n\u001b[32m 112\u001b[39m kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.\u001b[34m__name__\u001b[39m, has_token=has_token, kwargs=kwargs)\n\u001b[32m--> \u001b[39m\u001b[32m114\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\_snapshot_download.py:332\u001b[39m, in \u001b[36msnapshot_download\u001b[39m\u001b[34m(repo_id, repo_type, revision, cache_dir, local_dir, library_name, library_version, user_agent, proxies, etag_timeout, force_download, token, local_files_only, allow_patterns, ignore_patterns, max_workers, tqdm_class, headers, endpoint, local_dir_use_symlinks, resume_download)\u001b[39m\n\u001b[32m 330\u001b[39m _inner_hf_hub_download(file)\n\u001b[32m 331\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m332\u001b[39m \u001b[43mthread_map\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 333\u001b[39m \u001b[43m \u001b[49m\u001b[43m_inner_hf_hub_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 334\u001b[39m \u001b[43m \u001b[49m\u001b[43mfiltered_repo_files\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 335\u001b[39m \u001b[43m \u001b[49m\u001b[43mdesc\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtqdm_desc\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 336\u001b[39m \u001b[43m \u001b[49m\u001b[43mmax_workers\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmax_workers\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 337\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# User can use its own tqdm class or the default one from `huggingface_hub.utils`\u001b[39;49;00m\n\u001b[32m 338\u001b[39m \u001b[43m \u001b[49m\u001b[43mtqdm_class\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtqdm_class\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mhf_tqdm\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 339\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 341\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m local_dir \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 342\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mstr\u001b[39m(os.path.realpath(local_dir))\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\tqdm\\contrib\\concurrent.py:69\u001b[39m, in \u001b[36mthread_map\u001b[39m\u001b[34m(fn, *iterables, **tqdm_kwargs)\u001b[39m\n\u001b[32m 55\u001b[39m \u001b[38;5;250m\u001b[39m\u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m 56\u001b[39m \u001b[33;03mEquivalent of `list(map(fn, *iterables))`\u001b[39;00m\n\u001b[32m 57\u001b[39m \u001b[33;03mdriven by `concurrent.futures.ThreadPoolExecutor`.\u001b[39;00m\n\u001b[32m (...)\u001b[39m\u001b[32m 66\u001b[39m \u001b[33;03m [default: max(32, cpu_count() + 4)].\u001b[39;00m\n\u001b[32m 67\u001b[39m \u001b[33;03m\"\"\"\u001b[39;00m\n\u001b[32m 68\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mconcurrent\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mfutures\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m ThreadPoolExecutor\n\u001b[32m---> \u001b[39m\u001b[32m69\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_executor_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mThreadPoolExecutor\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43miterables\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mtqdm_kwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\tqdm\\contrib\\concurrent.py:51\u001b[39m, in \u001b[36m_executor_map\u001b[39m\u001b[34m(PoolExecutor, fn, *iterables, **tqdm_kwargs)\u001b[39m\n\u001b[32m 47\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m ensure_lock(tqdm_class, lock_name=lock_name) \u001b[38;5;28;01mas\u001b[39;00m lk:\n\u001b[32m 48\u001b[39m \u001b[38;5;66;03m# share lock in case workers are already using `tqdm`\u001b[39;00m\n\u001b[32m 49\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m PoolExecutor(max_workers=max_workers, initializer=tqdm_class.set_lock,\n\u001b[32m 50\u001b[39m initargs=(lk,)) \u001b[38;5;28;01mas\u001b[39;00m ex:\n\u001b[32m---> \u001b[39m\u001b[32m51\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mlist\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mtqdm_class\u001b[49m\u001b[43m(\u001b[49m\u001b[43mex\u001b[49m\u001b[43m.\u001b[49m\u001b[43mmap\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43miterables\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchunksize\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunksize\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\tqdm\\notebook.py:250\u001b[39m, in \u001b[36mtqdm_notebook.__iter__\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 248\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 249\u001b[39m it = \u001b[38;5;28msuper\u001b[39m().\u001b[34m__iter__\u001b[39m()\n\u001b[32m--> \u001b[39m\u001b[32m250\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mobj\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mit\u001b[49m\u001b[43m:\u001b[49m\n\u001b[32m 251\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# return super(tqdm...) will not catch exception\u001b[39;49;00m\n\u001b[32m 252\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43;01myield\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mobj\u001b[49m\n\u001b[32m 253\u001b[39m \u001b[38;5;66;03m# NB: except ... [ as ...] breaks IPython async KeyboardInterrupt\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\tqdm\\std.py:1181\u001b[39m, in \u001b[36mtqdm.__iter__\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 1178\u001b[39m time = \u001b[38;5;28mself\u001b[39m._time\n\u001b[32m 1180\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1181\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mobj\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43miterable\u001b[49m\u001b[43m:\u001b[49m\n\u001b[32m 1182\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43;01myield\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mobj\u001b[49m\n\u001b[32m 1183\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# Update and possibly print the progressbar.\u001b[39;49;00m\n\u001b[32m 1184\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# Note: does not call self.update(1) for speed optimisation.\u001b[39;49;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32mc:\\Python314\\Lib\\concurrent\\futures\\_base.py:639\u001b[39m, in \u001b[36mExecutor.map..result_iterator\u001b[39m\u001b[34m()\u001b[39m\n\u001b[32m 637\u001b[39m \u001b[38;5;66;03m# Careful not to keep a reference to the popped future\u001b[39;00m\n\u001b[32m 638\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m639\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m \u001b[43m_result_or_cancel\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfs\u001b[49m\u001b[43m.\u001b[49m\u001b[43mpop\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 640\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 641\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m _result_or_cancel(fs.pop(), end_time - time.monotonic())\n", + "\u001b[36mFile \u001b[39m\u001b[32mc:\\Python314\\Lib\\concurrent\\futures\\_base.py:311\u001b[39m, in \u001b[36m_result_or_cancel\u001b[39m\u001b[34m(***failed resolving arguments***)\u001b[39m\n\u001b[32m 309\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 310\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m311\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfut\u001b[49m\u001b[43m.\u001b[49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 312\u001b[39m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[32m 313\u001b[39m fut.cancel()\n", + "\u001b[36mFile \u001b[39m\u001b[32mc:\\Python314\\Lib\\concurrent\\futures\\_base.py:450\u001b[39m, in \u001b[36mFuture.result\u001b[39m\u001b[34m(self, timeout)\u001b[39m\n\u001b[32m 448\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m CancelledError()\n\u001b[32m 449\u001b[39m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._state == FINISHED:\n\u001b[32m--> \u001b[39m\u001b[32m450\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m__get_result\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 451\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 452\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTimeoutError\u001b[39;00m()\n", + "\u001b[36mFile \u001b[39m\u001b[32mc:\\Python314\\Lib\\concurrent\\futures\\_base.py:395\u001b[39m, in \u001b[36mFuture.__get_result\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 393\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._exception \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 394\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m395\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m._exception\n\u001b[32m 396\u001b[39m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[32m 397\u001b[39m \u001b[38;5;66;03m# Break a reference cycle with the exception in self._exception\u001b[39;00m\n\u001b[32m 398\u001b[39m \u001b[38;5;28mself\u001b[39m = \u001b[38;5;28;01mNone\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32mc:\\Python314\\Lib\\concurrent\\futures\\thread.py:86\u001b[39m, in \u001b[36m_WorkItem.run\u001b[39m\u001b[34m(self, ctx)\u001b[39m\n\u001b[32m 83\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[32m 85\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m---> \u001b[39m\u001b[32m86\u001b[39m result = \u001b[43mctx\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mtask\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 87\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[32m 88\u001b[39m \u001b[38;5;28mself\u001b[39m.future.set_exception(exc)\n", + "\u001b[36mFile \u001b[39m\u001b[32mc:\\Python314\\Lib\\concurrent\\futures\\thread.py:73\u001b[39m, in \u001b[36mWorkerContext.run\u001b[39m\u001b[34m(self, task)\u001b[39m\n\u001b[32m 71\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mrun\u001b[39m(\u001b[38;5;28mself\u001b[39m, task):\n\u001b[32m 72\u001b[39m fn, args, kwargs = task\n\u001b[32m---> \u001b[39m\u001b[32m73\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\_snapshot_download.py:306\u001b[39m, in \u001b[36msnapshot_download.._inner_hf_hub_download\u001b[39m\u001b[34m(repo_file)\u001b[39m\n\u001b[32m 305\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_inner_hf_hub_download\u001b[39m(repo_file: \u001b[38;5;28mstr\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m306\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mhf_hub_download\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 307\u001b[39m \u001b[43m \u001b[49m\u001b[43mrepo_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 308\u001b[39m \u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 309\u001b[39m \u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 310\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcommit_hash\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 311\u001b[39m \u001b[43m \u001b[49m\u001b[43mendpoint\u001b[49m\u001b[43m=\u001b[49m\u001b[43mendpoint\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 312\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 313\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 314\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_dir_use_symlinks\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_dir_use_symlinks\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 315\u001b[39m \u001b[43m \u001b[49m\u001b[43mlibrary_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlibrary_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 316\u001b[39m \u001b[43m \u001b[49m\u001b[43mlibrary_version\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlibrary_version\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 317\u001b[39m \u001b[43m \u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m=\u001b[49m\u001b[43muser_agent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 318\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 319\u001b[39m \u001b[43m \u001b[49m\u001b[43metag_timeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43metag_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 320\u001b[39m \u001b[43m \u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresume_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 321\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 322\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 323\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 324\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\_validators.py:114\u001b[39m, in \u001b[36mvalidate_hf_hub_args.._inner_fn\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 111\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m check_use_auth_token:\n\u001b[32m 112\u001b[39m kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.\u001b[34m__name__\u001b[39m, has_token=has_token, kwargs=kwargs)\n\u001b[32m--> \u001b[39m\u001b[32m114\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\file_download.py:1007\u001b[39m, in \u001b[36mhf_hub_download\u001b[39m\u001b[34m(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, user_agent, force_download, proxies, etag_timeout, token, local_files_only, headers, endpoint, resume_download, force_filename, local_dir_use_symlinks)\u001b[39m\n\u001b[32m 987\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m _hf_hub_download_to_local_dir(\n\u001b[32m 988\u001b[39m \u001b[38;5;66;03m# Destination\u001b[39;00m\n\u001b[32m 989\u001b[39m local_dir=local_dir,\n\u001b[32m (...)\u001b[39m\u001b[32m 1004\u001b[39m local_files_only=local_files_only,\n\u001b[32m 1005\u001b[39m )\n\u001b[32m 1006\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1007\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_hf_hub_download_to_cache_dir\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1008\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# Destination\u001b[39;49;00m\n\u001b[32m 1009\u001b[39m \u001b[43m \u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcache_dir\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1010\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# File info\u001b[39;49;00m\n\u001b[32m 1011\u001b[39m \u001b[43m \u001b[49m\u001b[43mrepo_id\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_id\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1012\u001b[39m \u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1013\u001b[39m \u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1014\u001b[39m \u001b[43m \u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrevision\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1015\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# HTTP info\u001b[39;49;00m\n\u001b[32m 1016\u001b[39m \u001b[43m \u001b[49m\u001b[43mendpoint\u001b[49m\u001b[43m=\u001b[49m\u001b[43mendpoint\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1017\u001b[39m \u001b[43m \u001b[49m\u001b[43metag_timeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43metag_timeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1018\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mhf_headers\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1019\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1020\u001b[39m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtoken\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1021\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# Additional options\u001b[39;49;00m\n\u001b[32m 1022\u001b[39m \u001b[43m \u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlocal_files_only\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1023\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1024\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\file_download.py:1168\u001b[39m, in \u001b[36m_hf_hub_download_to_cache_dir\u001b[39m\u001b[34m(cache_dir, repo_id, filename, repo_type, revision, endpoint, etag_timeout, headers, proxies, token, local_files_only, force_download)\u001b[39m\n\u001b[32m 1165\u001b[39m \u001b[38;5;66;03m# Local file doesn't exist or etag isn't a match => retrieve file from remote (or cache)\u001b[39;00m\n\u001b[32m 1167\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m WeakFileLock(lock_path):\n\u001b[32m-> \u001b[39m\u001b[32m1168\u001b[39m \u001b[43m_download_to_tmp_and_move\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1169\u001b[39m \u001b[43m \u001b[49m\u001b[43mincomplete_path\u001b[49m\u001b[43m=\u001b[49m\u001b[43mPath\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblob_path\u001b[49m\u001b[43m \u001b[49m\u001b[43m+\u001b[49m\u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43m.incomplete\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1170\u001b[39m \u001b[43m \u001b[49m\u001b[43mdestination_path\u001b[49m\u001b[43m=\u001b[49m\u001b[43mPath\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblob_path\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1171\u001b[39m \u001b[43m \u001b[49m\u001b[43murl_to_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl_to_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1172\u001b[39m \u001b[43m \u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m=\u001b[49m\u001b[43mproxies\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1173\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1174\u001b[39m \u001b[43m \u001b[49m\u001b[43mexpected_size\u001b[49m\u001b[43m=\u001b[49m\u001b[43mexpected_size\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1175\u001b[39m \u001b[43m \u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1176\u001b[39m \u001b[43m \u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m=\u001b[49m\u001b[43mforce_download\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1177\u001b[39m \u001b[43m \u001b[49m\u001b[43metag\u001b[49m\u001b[43m=\u001b[49m\u001b[43metag\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1178\u001b[39m \u001b[43m \u001b[49m\u001b[43mxet_file_data\u001b[49m\u001b[43m=\u001b[49m\u001b[43mxet_file_data\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1179\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1180\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m os.path.exists(pointer_path):\n\u001b[32m 1181\u001b[39m _create_symlink(blob_path, pointer_path, new_blob=\u001b[38;5;28;01mTrue\u001b[39;00m)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\file_download.py:1720\u001b[39m, in \u001b[36m_download_to_tmp_and_move\u001b[39m\u001b[34m(incomplete_path, destination_path, url_to_download, proxies, headers, expected_size, filename, force_download, etag, xet_file_data)\u001b[39m\n\u001b[32m 1718\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m xet_file_data \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m is_xet_available():\n\u001b[32m 1719\u001b[39m logger.debug(\u001b[33m\"\u001b[39m\u001b[33mXet Storage is enabled for this repo. Downloading file from Xet Storage..\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m-> \u001b[39m\u001b[32m1720\u001b[39m \u001b[43mxet_get\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 1721\u001b[39m \u001b[43m \u001b[49m\u001b[43mincomplete_path\u001b[49m\u001b[43m=\u001b[49m\u001b[43mincomplete_path\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1722\u001b[39m \u001b[43m \u001b[49m\u001b[43mxet_file_data\u001b[49m\u001b[43m=\u001b[49m\u001b[43mxet_file_data\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1723\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1724\u001b[39m \u001b[43m \u001b[49m\u001b[43mexpected_size\u001b[49m\u001b[43m=\u001b[49m\u001b[43mexpected_size\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1725\u001b[39m \u001b[43m \u001b[49m\u001b[43mdisplayed_filename\u001b[49m\u001b[43m=\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1726\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1727\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1728\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m xet_file_data \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m constants.HF_HUB_DISABLE_XET:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\file_download.py:612\u001b[39m, in \u001b[36mxet_get\u001b[39m\u001b[34m(incomplete_path, xet_file_data, headers, expected_size, displayed_filename, _tqdm_bar)\u001b[39m\n\u001b[32m 609\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(displayed_filename) > \u001b[32m40\u001b[39m:\n\u001b[32m 610\u001b[39m displayed_filename = \u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdisplayed_filename[:\u001b[32m40\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m(…)\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m--> \u001b[39m\u001b[32m612\u001b[39m progress_cm = \u001b[43m_get_progress_bar_context\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 613\u001b[39m \u001b[43m \u001b[49m\u001b[43mdesc\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdisplayed_filename\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 614\u001b[39m \u001b[43m \u001b[49m\u001b[43mlog_level\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlogger\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetEffectiveLevel\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 615\u001b[39m \u001b[43m \u001b[49m\u001b[43mtotal\u001b[49m\u001b[43m=\u001b[49m\u001b[43mexpected_size\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 616\u001b[39m \u001b[43m \u001b[49m\u001b[43minitial\u001b[49m\u001b[43m=\u001b[49m\u001b[32;43m0\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 617\u001b[39m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mhuggingface_hub.xet_get\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 618\u001b[39m \u001b[43m \u001b[49m\u001b[43m_tqdm_bar\u001b[49m\u001b[43m=\u001b[49m\u001b[43m_tqdm_bar\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 619\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 621\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m progress_cm \u001b[38;5;28;01mas\u001b[39;00m progress:\n\u001b[32m 623\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mprogress_updater\u001b[39m(progress_bytes: \u001b[38;5;28mfloat\u001b[39m):\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\tqdm.py:299\u001b[39m, in \u001b[36m_get_progress_bar_context\u001b[39m\u001b[34m(desc, log_level, total, initial, unit, unit_scale, name, _tqdm_bar)\u001b[39m\n\u001b[32m 294\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m nullcontext(_tqdm_bar)\n\u001b[32m 295\u001b[39m \u001b[38;5;66;03m# ^ `contextlib.nullcontext` mimics a context manager that does nothing\u001b[39;00m\n\u001b[32m 296\u001b[39m \u001b[38;5;66;03m# Makes it easier to use the same code path for both cases but in the later\u001b[39;00m\n\u001b[32m 297\u001b[39m \u001b[38;5;66;03m# case, the progress bar is not closed when exiting the context manager.\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m299\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mtqdm\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 300\u001b[39m \u001b[43m \u001b[49m\u001b[43munit\u001b[49m\u001b[43m=\u001b[49m\u001b[43munit\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 301\u001b[39m \u001b[43m \u001b[49m\u001b[43munit_scale\u001b[49m\u001b[43m=\u001b[49m\u001b[43munit_scale\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 302\u001b[39m \u001b[43m \u001b[49m\u001b[43mtotal\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtotal\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 303\u001b[39m \u001b[43m \u001b[49m\u001b[43minitial\u001b[49m\u001b[43m=\u001b[49m\u001b[43minitial\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 304\u001b[39m \u001b[43m \u001b[49m\u001b[43mdesc\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdesc\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 305\u001b[39m \u001b[43m \u001b[49m\u001b[43mdisable\u001b[49m\u001b[43m=\u001b[49m\u001b[43mis_tqdm_disabled\u001b[49m\u001b[43m(\u001b[49m\u001b[43mlog_level\u001b[49m\u001b[43m=\u001b[49m\u001b[43mlog_level\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 306\u001b[39m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[43m=\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 307\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\huggingface_hub\\utils\\tqdm.py:225\u001b[39m, in \u001b[36mtqdm.__init__\u001b[39m\u001b[34m(self, *args, **kwargs)\u001b[39m\n\u001b[32m 223\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m are_progress_bars_disabled(name):\n\u001b[32m 224\u001b[39m kwargs[\u001b[33m\"\u001b[39m\u001b[33mdisable\u001b[39m\u001b[33m\"\u001b[39m] = \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m225\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[34;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\tqdm\\notebook.py:234\u001b[39m, in \u001b[36mtqdm_notebook.__init__\u001b[39m\u001b[34m(self, *args, **kwargs)\u001b[39m\n\u001b[32m 232\u001b[39m unit_scale = \u001b[32m1\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.unit_scale \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28mself\u001b[39m.unit_scale \u001b[38;5;129;01mor\u001b[39;00m \u001b[32m1\u001b[39m\n\u001b[32m 233\u001b[39m total = \u001b[38;5;28mself\u001b[39m.total * unit_scale \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.total \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28mself\u001b[39m.total\n\u001b[32m--> \u001b[39m\u001b[32m234\u001b[39m \u001b[38;5;28mself\u001b[39m.container = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mstatus_printer\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mfp\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtotal\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mdesc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mncols\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 235\u001b[39m \u001b[38;5;28mself\u001b[39m.container.pbar = proxy(\u001b[38;5;28mself\u001b[39m)\n\u001b[32m 236\u001b[39m \u001b[38;5;28mself\u001b[39m.displayed = \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\tqdm\\notebook.py:110\u001b[39m, in \u001b[36mtqdm_notebook.status_printer\u001b[39m\u001b[34m(_, total, desc, ncols)\u001b[39m\n\u001b[32m 108\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mImportError\u001b[39;00m(WARN_NOIPYW)\n\u001b[32m 109\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m total:\n\u001b[32m--> \u001b[39m\u001b[32m110\u001b[39m pbar = \u001b[43mIProgress\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mmin\u001b[39;49m\u001b[43m=\u001b[49m\u001b[32;43m0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mmax\u001b[39;49m\u001b[43m=\u001b[49m\u001b[43mtotal\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 111\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m: \u001b[38;5;66;03m# No total? Show info style bar with no progress tqdm status\u001b[39;00m\n\u001b[32m 112\u001b[39m pbar = IProgress(\u001b[38;5;28mmin\u001b[39m=\u001b[32m0\u001b[39m, \u001b[38;5;28mmax\u001b[39m=\u001b[32m1\u001b[39m)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget_float.py:26\u001b[39m, in \u001b[36m_Float.__init__\u001b[39m\u001b[34m(self, value, **kwargs)\u001b[39m\n\u001b[32m 24\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 25\u001b[39m kwargs[\u001b[33m'\u001b[39m\u001b[33mvalue\u001b[39m\u001b[33m'\u001b[39m] = value\n\u001b[32m---> \u001b[39m\u001b[32m26\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[34;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget_description.py:35\u001b[39m, in \u001b[36mDescriptionWidget.__init__\u001b[39m\u001b[34m(self, *args, **kwargs)\u001b[39m\n\u001b[32m 33\u001b[39m kwargs.setdefault(\u001b[33m'\u001b[39m\u001b[33mtooltip\u001b[39m\u001b[33m'\u001b[39m, kwargs[\u001b[33m'\u001b[39m\u001b[33mdescription_tooltip\u001b[39m\u001b[33m'\u001b[39m])\n\u001b[32m 34\u001b[39m \u001b[38;5;28;01mdel\u001b[39;00m kwargs[\u001b[33m'\u001b[39m\u001b[33mdescription_tooltip\u001b[39m\u001b[33m'\u001b[39m]\n\u001b[32m---> \u001b[39m\u001b[32m35\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[34;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget.py:506\u001b[39m, in \u001b[36mWidget.__init__\u001b[39m\u001b[34m(self, **kwargs)\u001b[39m\n\u001b[32m 503\u001b[39m \u001b[38;5;28msuper\u001b[39m().\u001b[34m__init__\u001b[39m(**kwargs)\n\u001b[32m 505\u001b[39m Widget._call_widget_constructed(\u001b[38;5;28mself\u001b[39m)\n\u001b[32m--> \u001b[39m\u001b[32m506\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget.py:525\u001b[39m, in \u001b[36mWidget.open\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 523\u001b[39m \u001b[38;5;250m\u001b[39m\u001b[33;03m\"\"\"Open a comm to the frontend if one isn't already open.\"\"\"\u001b[39;00m\n\u001b[32m 524\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.comm \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m525\u001b[39m state, buffer_paths, buffers = _remove_buffers(\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mget_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[32m 527\u001b[39m args = \u001b[38;5;28mdict\u001b[39m(target_name=\u001b[33m'\u001b[39m\u001b[33mjupyter.widget\u001b[39m\u001b[33m'\u001b[39m,\n\u001b[32m 528\u001b[39m data={\u001b[33m'\u001b[39m\u001b[33mstate\u001b[39m\u001b[33m'\u001b[39m: state, \u001b[33m'\u001b[39m\u001b[33mbuffer_paths\u001b[39m\u001b[33m'\u001b[39m: buffer_paths},\n\u001b[32m 529\u001b[39m buffers=buffers,\n\u001b[32m 530\u001b[39m metadata={\u001b[33m'\u001b[39m\u001b[33mversion\u001b[39m\u001b[33m'\u001b[39m: __protocol_version__}\n\u001b[32m 531\u001b[39m )\n\u001b[32m 532\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._model_id \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget.py:615\u001b[39m, in \u001b[36mWidget.get_state\u001b[39m\u001b[34m(self, key, drop_defaults)\u001b[39m\n\u001b[32m 613\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m k \u001b[38;5;129;01min\u001b[39;00m keys:\n\u001b[32m 614\u001b[39m to_json = \u001b[38;5;28mself\u001b[39m.trait_metadata(k, \u001b[33m'\u001b[39m\u001b[33mto_json\u001b[39m\u001b[33m'\u001b[39m, \u001b[38;5;28mself\u001b[39m._trait_to_json)\n\u001b[32m--> \u001b[39m\u001b[32m615\u001b[39m value = to_json(\u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mk\u001b[49m\u001b[43m)\u001b[49m, \u001b[38;5;28mself\u001b[39m)\n\u001b[32m 616\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m drop_defaults \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m._compare(value, traits[k].default_value):\n\u001b[32m 617\u001b[39m state[k] = value\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\traitlets\\traitlets.py:687\u001b[39m, in \u001b[36mTraitType.__get__\u001b[39m\u001b[34m(self, obj, cls)\u001b[39m\n\u001b[32m 685\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\n\u001b[32m 686\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m687\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m t.cast(G, \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mcls\u001b[39;49m\u001b[43m)\u001b[49m)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\traitlets\\traitlets.py:635\u001b[39m, in \u001b[36mTraitType.get\u001b[39m\u001b[34m(self, obj, cls)\u001b[39m\n\u001b[32m 632\u001b[39m value = obj._trait_values[\u001b[38;5;28mself\u001b[39m.name]\n\u001b[32m 633\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m:\n\u001b[32m 634\u001b[39m \u001b[38;5;66;03m# Check for a dynamic initializer.\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m635\u001b[39m default = \u001b[43mobj\u001b[49m\u001b[43m.\u001b[49m\u001b[43mtrait_defaults\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mname\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 636\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m default \u001b[38;5;129;01mis\u001b[39;00m Undefined:\n\u001b[32m 637\u001b[39m warn(\n\u001b[32m 638\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mExplicit using of Undefined as the default value \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 639\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mis deprecated in traitlets 5.0, and may cause \u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m (...)\u001b[39m\u001b[32m 642\u001b[39m stacklevel=\u001b[32m2\u001b[39m,\n\u001b[32m 643\u001b[39m )\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\traitlets\\traitlets.py:1897\u001b[39m, in \u001b[36mHasTraits.trait_defaults\u001b[39m\u001b[34m(self, *names, **metadata)\u001b[39m\n\u001b[32m 1894\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m TraitError(\u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mn\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m is not a trait of \u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mtype\u001b[39m(\u001b[38;5;28mself\u001b[39m).\u001b[34m__name__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\u001b[33m instances\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 1896\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(names) == \u001b[32m1\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(metadata) == \u001b[32m0\u001b[39m:\n\u001b[32m-> \u001b[39m\u001b[32m1897\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m t.cast(Sentinel, \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_get_trait_default_generator\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnames\u001b[49m\u001b[43m[\u001b[49m\u001b[32;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m)\n\u001b[32m 1899\u001b[39m trait_names = \u001b[38;5;28mself\u001b[39m.trait_names(**metadata)\n\u001b[32m 1900\u001b[39m trait_names.extend(names)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\traitlets\\traitlets.py:602\u001b[39m, in \u001b[36mTraitType.default\u001b[39m\u001b[34m(self, obj)\u001b[39m\n\u001b[32m 600\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m t.cast(G, \u001b[38;5;28mself\u001b[39m.default_value)\n\u001b[32m 601\u001b[39m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[33m\"\u001b[39m\u001b[33mmake_dynamic_default\u001b[39m\u001b[33m\"\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m602\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m t.cast(G, \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mmake_dynamic_default\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[32m 603\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 604\u001b[39m \u001b[38;5;66;03m# Undefined will raise in TraitType.get\u001b[39;00m\n\u001b[32m 605\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m t.cast(G, \u001b[38;5;28mself\u001b[39m.default_value)\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\trait_types.py:409\u001b[39m, in \u001b[36mInstanceDict.make_dynamic_default\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 408\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mmake_dynamic_default\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m409\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mklass\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mdefault_args\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 410\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mdefault_kwargs\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43m{\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget_layout.py:86\u001b[39m, in \u001b[36mLayout.__init__\u001b[39m\u001b[34m(self, **kwargs)\u001b[39m\n\u001b[32m 83\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m side \u001b[38;5;129;01min\u001b[39;00m [\u001b[33m'\u001b[39m\u001b[33mtop\u001b[39m\u001b[33m'\u001b[39m, \u001b[33m'\u001b[39m\u001b[33mright\u001b[39m\u001b[33m'\u001b[39m, \u001b[33m'\u001b[39m\u001b[33mbottom\u001b[39m\u001b[33m'\u001b[39m, \u001b[33m'\u001b[39m\u001b[33mleft\u001b[39m\u001b[33m'\u001b[39m]:\n\u001b[32m 84\u001b[39m kwargs.setdefault(\u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33mborder_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mside\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m, border)\n\u001b[32m---> \u001b[39m\u001b[32m86\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[34;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget.py:506\u001b[39m, in \u001b[36mWidget.__init__\u001b[39m\u001b[34m(self, **kwargs)\u001b[39m\n\u001b[32m 503\u001b[39m \u001b[38;5;28msuper\u001b[39m().\u001b[34m__init__\u001b[39m(**kwargs)\n\u001b[32m 505\u001b[39m Widget._call_widget_constructed(\u001b[38;5;28mself\u001b[39m)\n\u001b[32m--> \u001b[39m\u001b[32m506\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\widgets\\widget.py:535\u001b[39m, in \u001b[36mWidget.open\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 532\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m._model_id \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 533\u001b[39m args[\u001b[33m'\u001b[39m\u001b[33mcomm_id\u001b[39m\u001b[33m'\u001b[39m] = \u001b[38;5;28mself\u001b[39m._model_id\n\u001b[32m--> \u001b[39m\u001b[32m535\u001b[39m \u001b[38;5;28mself\u001b[39m.comm = \u001b[43mcomm\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcreate_comm\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipywidgets\\comm.py:33\u001b[39m, in \u001b[36mcreate_comm\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 31\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m Comm(*args, **kwargs)\n\u001b[32m 32\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m---> \u001b[39m\u001b[32m33\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcomm\u001b[49m\u001b[43m.\u001b[49m\u001b[43mcreate_comm\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipykernel\\ipkernel.py:52\u001b[39m, in \u001b[36m_create_comm\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 50\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_create_comm\u001b[39m(*args, **kwargs):\n\u001b[32m 51\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33;03m\"\"\"Create a new Comm.\"\"\"\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m52\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mBaseComm\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\comm\\base_comm.py:65\u001b[39m, in \u001b[36mBaseComm.__init__\u001b[39m\u001b[34m(self, target_name, data, metadata, buffers, comm_id, primary, target_module, topic, _open_data, _close_data, **kwargs)\u001b[39m\n\u001b[32m 61\u001b[39m \u001b[38;5;28mself\u001b[39m._closed = \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[32m 63\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.primary:\n\u001b[32m 64\u001b[39m \u001b[38;5;66;03m# I am primary, open my peer.\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m65\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmetadata\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmetadata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffers\u001b[49m\u001b[43m=\u001b[49m\u001b[43mbuffers\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 66\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 67\u001b[39m \u001b[38;5;28mself\u001b[39m._closed = \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\comm\\base_comm.py:103\u001b[39m, in \u001b[36mBaseComm.open\u001b[39m\u001b[34m(self, data, metadata, buffers)\u001b[39m\n\u001b[32m 101\u001b[39m comm_manager.register_comm(\u001b[38;5;28mself\u001b[39m)\n\u001b[32m 102\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m103\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mpublish_msg\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 104\u001b[39m \u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mcomm_open\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 105\u001b[39m \u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 106\u001b[39m \u001b[43m \u001b[49m\u001b[43mmetadata\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmetadata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 107\u001b[39m \u001b[43m \u001b[49m\u001b[43mbuffers\u001b[49m\u001b[43m=\u001b[49m\u001b[43mbuffers\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 108\u001b[39m \u001b[43m \u001b[49m\u001b[43mtarget_name\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mtarget_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 109\u001b[39m \u001b[43m \u001b[49m\u001b[43mtarget_module\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mtarget_module\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 110\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 111\u001b[39m \u001b[38;5;28mself\u001b[39m._closed = \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[32m 112\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipykernel\\comm\\comm.py:42\u001b[39m, in \u001b[36mBaseComm.publish_msg\u001b[39m\u001b[34m(self, msg_type, data, metadata, buffers, **keys)\u001b[39m\n\u001b[32m 34\u001b[39m \u001b[38;5;28mself\u001b[39m.kernel = Kernel.instance()\n\u001b[32m 36\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m.kernel.session \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 37\u001b[39m \u001b[38;5;28mself\u001b[39m.kernel.session.send(\n\u001b[32m 38\u001b[39m \u001b[38;5;28mself\u001b[39m.kernel.iopub_socket,\n\u001b[32m 39\u001b[39m msg_type,\n\u001b[32m 40\u001b[39m content,\n\u001b[32m 41\u001b[39m metadata=json_clean(metadata),\n\u001b[32m---> \u001b[39m\u001b[32m42\u001b[39m parent=\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mkernel\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget_parent\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m,\n\u001b[32m 43\u001b[39m ident=\u001b[38;5;28mself\u001b[39m.topic,\n\u001b[32m 44\u001b[39m buffers=buffers,\n\u001b[32m 45\u001b[39m )\n", + "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python314\\site-packages\\ipykernel\\kernelbase.py:797\u001b[39m, in \u001b[36mKernel.get_parent\u001b[39m\u001b[34m(self, channel)\u001b[39m\n\u001b[32m 795\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m channel == \u001b[33m\"\u001b[39m\u001b[33mcontrol\u001b[39m\u001b[33m\"\u001b[39m:\n\u001b[32m 796\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._control_parent\n\u001b[32m--> \u001b[39m\u001b[32m797\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_shell_parent\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[31mLookupError\u001b[39m: " + ] + } + ], + "source": [ + "\n", + "# Load model directly\n", + "from transformers import AutoTokenizer, AutoModelForCausalLM\n", + "from huggingface_hub import login\n", + "login()\n", + "\n", + "model_id = \"meta-llama/Meta-Llama-3.1-8B-Instruct\"\n", + "tokenizer = AutoTokenizer.from_pretrained(model_id) \n", + "model = AutoModelForCausalLM.from_pretrained(model_id) \n", + "\n", + "prompt = \"The Eiffel Tower is located in\"\n", + "inputs = tokenizer(prompt, return_tensors=\"pt\")\n", + "\n", + "outputs = model.generate(**inputs, max_new_tokens=10)\n", + "print(tokenizer.decode(outputs[0], skip_special_tokens=True))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/class2/langChain/Inference_llama3.ipynb b/class2/langChain/Inference_llama3.ipynb new file mode 100644 index 0000000..173439f --- /dev/null +++ b/class2/langChain/Inference_llama3.ipynb @@ -0,0 +1,60 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "4ccba689", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ChatCompletionOutputMessage(role='assistant', content=\"Spanish Paella is a classic and flavorful dish that originated in the Valencia region of Spain. It's a traditional rice dish cooked in a large, shallow pan called a paellera. Here's a step-by-step guide to cooking a delicious Spanish Paella:\\n\\n**Ingredients:**\\n\\n* 1 cup uncooked Calasparra rice (or Spanish short-grain rice)\\n* 2 tablespoons olive oil\\n* 1 onion, diced\\n* 2 cloves garlic, minced\\n* 1 pound mixed seafood (shrimp, mussels, clams, squid)\\n* 1 pound chorizo, sliced\\n* 1 pound chicken breast or thighs, cut into bite-sized pieces\\n* 1 teaspoon smoked paprika (optional)\\n* 1 teaspoon saffron threads, soaked in 2 tablespoons hot water\\n* Salt and pepper, to taste\\n* 4 cups chicken broth\\n* 1 cup water\\n* Lemon wedges, for serving\\n\\n**Instructions:**\\n\\n1. **Heat the paellera**: Heat the paellera over medium-high heat. When hot, add the olive oil and swirl it around.\\n2. **Sauté the onion and garlic**: Add the diced onion and minced garlic to the paellera. Cook until the onion is translucent, about 5 minutes.\\n3. **Add the chorizo and chicken**: Add the sliced chorizo and chicken to the paellera. Cook until the chicken is browned and the chorizo is crispy, about 5-7 minutes.\\n4. **Add the seafood**: Add the mixed seafood to the paellera. Cook until the seafood is lightly browned, about 2-3 minutes.\\n5. **Add the rice**: Add the Calasparra rice to the paellera. Stir to coat the rice in oil and mix with the other ingredients. Cook for 1-2 minutes.\\n6. **Add the paprika, saffron, and broth**: Add the smoked paprika (if using), soaked saffron, chicken broth, and water to the paellera. Stir to combine.\\n7. **Bring to a boil**: Bring the mixture to a boil, then reduce the heat to low and simmer, covered, for 20-25 minutes or until the rice is cooked and the liquid has been absorbed.\\n8. **Socarrat time**: After 20-25 minutes, increase the heat to high and cook for 2-3 minutes, or until the bottom layer of the paella is crispy and golden brown (this is called the socarrat).\\n9. **Serve**: Remove the paellera from the heat and let it rest for 5 minutes. Serve the paella hot, garnished with lemon wedges.\\n\\n**Tips and Variations:**\\n\\n* Use a high-quality paellera to achieve the perfect socarrat.\\n* Traditionally, Paella is cooked over an open flame, which helps to achieve the crispy bottom.\\n* You can customize your Paella with different types of seafood, vegetables, or meats.\\n* If you can't find Calasparra rice, you can use Spanish short-grain rice as a substitute.\\n* Don't overcrowd the paellera, as this can lead to uneven cooking.\\n\\nI hope you enjoy making and eating this delicious Spanish Paella!\", reasoning=None, tool_call_id=None, tool_calls=None)\n" + ] + } + ], + "source": [ + "import os\n", + "from huggingface_hub import InferenceClient\n", + "\n", + "client = InferenceClient(\n", + " api_key=os.environ[\"HF_TOKEN\"]\n", + ")\n", + "\n", + "completion = client.chat.completions.create(\n", + " model=\"meta-llama/Llama-3.1-8B-Instruct\",\n", + " messages=[\n", + " {\n", + " \"role\": \"user\",\n", + " \"content\": \"I like to eat Spanish Paella very much. How to cook it?\"\n", + " }\n", + " ],\n", + ")\n", + "\n", + "print(completion.choices[0].message)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/class2/langChain/OpenAI_llama3.ipynb b/class2/langChain/OpenAI_llama3.ipynb new file mode 100644 index 0000000..a3e4821 --- /dev/null +++ b/class2/langChain/OpenAI_llama3.ipynb @@ -0,0 +1,61 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "id": "5460de56", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ChatCompletionMessage(content='In networking, the pre-handshake, also known as the pre-authentication phase, is the initial step in the connection process between a client and a server. It typically occurs before the full handshake process is completed.\\n\\nDuring the pre-handshake phase, the client and server perform the following steps:\\n\\n1. **Initial Discovery**: The client discovers the server\\'s presence and IP address. This is usually done through DNS resolution or by querying a name server.\\n2. **Authentication Exchange**: The client and server exchange authentication information to establish a secure connection. This involves the exchange of authentication packets.\\n3. **Key Exchange**: If a secure connection is established, the client and server perform a key exchange to determine the encryption keys to be used for the session.\\n\\nPre-handshake is an important step in the connection process as it allows the client and server to establish a secure connection and exchange authentication information before proceeding with the handshake.\\n\\nOne of the most common examples of a pre-handshake is the **TLS (Transport Layer Security) Handshake**, which includes the following phases:\\n\\n1. **Client Hello**: The client sends a \"Client Hello\" message to the server, which includes the client\\'s SSL/TLS version, cipher suites, and other parameters.\\n2. **Server Hello**: The server responds with a \"Server Hello\" message, which includes the server\\'s SSL/TLS version, cipher suite, and other parameters.\\n3. **Certificate Exchange**: The server sends its digital certificate to the client.\\n4. **Key Exchange**: The client and server perform a key exchange to determine the encryption keys.\\n5. **Pre-Master Secret**: The client and server exchange the pre-master secret.\\n6. **Change Cipher Spec**: The client and server send \"Change Cipher Spec\" messages to each other to indicate that the session keys have been changed.\\n7. **Finished**: The client and server send \"Finished\" messages to each other to verify that the handshake is complete.\\n\\nThe pre-handshake phase is an essential part of the TLS handshake process and allows the client and server to establish a secure connection.\\n\\nHere is a simple example of what pre-handshake might look like in code. For example with Python:\\n\\n```python\\nimport socket\\nimport ssl\\n\\n# Create a context\\ncontext = ssl.create_default_context()\\n\\n# Create a socket\\nwith socket.socket(socket.AF_INET) as s:\\n # Wrap the socket\\n with context.wrap_socket(s, server_hostname=\"www.example.com\") as s_ssl:\\n # Here the pre-handshake is done\\n # The handshake is completed in the next steps\\n # You can check the cipher used and the cert\\n print(s_ssl.cipher())\\n print(s_ssl.getpeercert())\\n```\\n\\nIn this example, the `wrap_socket` method performs the pre-handshake and establishes a secure connection.', refusal=None, role='assistant', annotations=None, audio=None, function_call=None, tool_calls=None)\n" + ] + } + ], + "source": [ + "import os\n", + "from openai import OpenAI\n", + "\n", + "client = OpenAI(\n", + " base_url=\"https://router.huggingface.co/v1\",\n", + " api_key=os.environ[\"HF_TOKEN\"],\n", + ")\n", + "\n", + "completion = client.chat.completions.create(\n", + " model=\"meta-llama/Meta-Llama-3-8B-Instruct\",\n", + " messages=[\n", + " {\n", + " \"role\": \"user\",\n", + " \"content\": \"What's pre-handshake in networking?\"\n", + " }\n", + " ],\n", + ")\n", + "\n", + "print(completion.choices[0].message)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.14.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}