From a31fa6a9cb3424dabb75bced88329f1e049e1ac9 Mon Sep 17 00:00:00 2001 From: Iryna Date: Thu, 27 Mar 2025 10:32:22 -0400 Subject: [PATCH 1/3] day1 lab --- .../day-1-linkedin-comment.ipynb | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 week1/community-contributions/day-1-linkedin-comment.ipynb diff --git a/week1/community-contributions/day-1-linkedin-comment.ipynb b/week1/community-contributions/day-1-linkedin-comment.ipynb new file mode 100644 index 0000000..b8de8c3 --- /dev/null +++ b/week1/community-contributions/day-1-linkedin-comment.ipynb @@ -0,0 +1,236 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# My first lab" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# imports\n", + "\n", + "import os\n", + "import requests\n", + "from dotenv import load_dotenv\n", + "from bs4 import BeautifulSoup\n", + "from IPython.display import Markdown, display\n", + "from openai import OpenAI\n", + "\n", + "# If you get an error running this cell, then please head over to the troubleshooting notebook!" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "API key found and looks good so far!\n" + ] + } + ], + "source": [ + "# Load environment variables in a file called .env\n", + "\n", + "load_dotenv(override=True)\n", + "api_key = os.getenv('OPENAI_API_KEY')\n", + "\n", + "# Check the key\n", + "\n", + "if not api_key:\n", + " print(\"No API key was found - please head over to the troubleshooting notebook in this folder to identify & fix!\")\n", + "elif not api_key.startswith(\"sk-proj-\"):\n", + " print(\"An API key was found, but it doesn't start sk-proj-; please check you're using the right key - see troubleshooting notebook\")\n", + "elif api_key.strip() != api_key:\n", + " print(\"An API key was found, but it looks like it might have space or tab characters at the start or end - please remove them - see troubleshooting notebook\")\n", + "else:\n", + " print(\"API key found and looks good so far!\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "openai = OpenAI()\n", + "\n", + "# If this doesn't work, try Kernel menu >> Restart Kernel and Clear Outputs Of All Cells, then run the cells from the top of this notebook down.\n", + "# If it STILL doesn't work (horrors!) then please see the Troubleshooting notebook in this folder for full instructions" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# A class to represent a Webpage\n", + "# If you're not familiar with Classes, check out the \"Intermediate Python\" notebook\n", + "\n", + "# Some websites need you to use proper headers when fetching them:\n", + "headers = {\n", + " \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36\"\n", + "}\n", + "\n", + "class Website:\n", + "\n", + " def __init__(self, url):\n", + " \"\"\"\n", + " Create this Website object from the given url using the BeautifulSoup library\n", + " \"\"\"\n", + " self.url = url\n", + " response = requests.get(url, headers=headers)\n", + " soup = BeautifulSoup(response.content, 'html.parser')\n", + " self.title = soup.title.string if soup.title else \"No title found\"\n", + " for irrelevant in soup.body([\"script\", \"style\", \"img\", \"input\"]):\n", + " irrelevant.decompose()\n", + " self.text = soup.body.get_text(separator=\"\\n\", strip=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "system_prompt = \"You are an assistant that analyzes the contents of a post on LinkedIn and provides a short, relevant, and thoughtful comment on it. \\\n", + "Ignore text that might be navigation related. Keep the tone professional and conversational. Respond in plain text.\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "def user_prompt_for(website):\n", + " return f\"\"\"\n", + "You are reading a LinkedIn post titled: \"{website.title}\"\n", + "\n", + "Here is the full content of the post:\n", + "{website.text}\n", + "\n", + "Write a short, thoughtful comment that could be posted as a reply.\n", + "\"\"\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# See how this function creates exactly the format above\n", + "\n", + "def messages_for(website):\n", + " return [\n", + " {\"role\": \"system\", \"content\": system_prompt},\n", + " {\"role\": \"user\", \"content\": user_prompt_for(website)}\n", + " ]" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# And now: call the OpenAI API. You will get very familiar with this!\n", + "\n", + "def generate_comment(url):\n", + " website = Website(url)\n", + " response = openai.chat.completions.create(\n", + " model = \"gpt-4o-mini\",\n", + " messages = messages_for(website)\n", + " )\n", + " return response.choices[0].message.content" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\"It's certainly concerning when private individuals are involved in sensitive government matters, especially when it comes to national security. It highlights the need for clarity about roles and responsibilities within our systems. Collaboration is crucial, but it must be balanced with the seriousness and gravity of the issues at hand. Thank you for bringing this to our attention, Roman.\"" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "generate_comment(\"https://www.linkedin.com/posts/roman-sheremeta-14972a50_this-just-keeps-getting-better-now-elon-activity-7310735395833405442-sf2M?utm_source=share&utm_medium=member_desktop&rcm=ACoAAETGRocBBwfTpcFHYHGUMNKtk0S5TVTccRw\")" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "# A function to display this nicely in the Jupyter output, using markdown\n", + "\n", + "def display_comment(url):\n", + " comment = generate_comment(url)\n", + " display(Markdown(comment))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "This situation certainly raises important questions about security and information sharing in sensitive contexts. Miscommunication can have significant consequences, especially when it involves national security matters. It will be interesting to see how this unfolds and what measures may be put in place to prevent similar incidents in the future." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display_comment(\"https://www.linkedin.com/posts/roman-sheremeta-14972a50_this-just-keeps-getting-better-now-elon-activity-7310735395833405442-sf2M?utm_source=share&utm_medium=member_desktop&rcm=ACoAAETGRocBBwfTpcFHYHGUMNKtk0S5TVTccRw\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "llms", + "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.11.11" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 80af4c2c8a72f69fd8692a7bf768d1254fada00b Mon Sep 17 00:00:00 2001 From: Iryna Date: Fri, 28 Mar 2025 15:12:22 -0400 Subject: [PATCH 2/3] finished week1 --- week1/day1.ipynb | 321 +++- week1/day5.ipynb | 3569 +++++++++++++++++++++++++++++++++++- week1/week1 EXERCISE.ipynb | 281 ++- 3 files changed, 4085 insertions(+), 86 deletions(-) diff --git a/week1/day1.ipynb b/week1/day1.ipynb index 27684fe..073857a 100644 --- a/week1/day1.ipynb +++ b/week1/day1.ipynb @@ -90,7 +90,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd", "metadata": {}, "outputs": [], @@ -129,10 +129,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "7b87cadb-d513-4303-baee-a37b6f938e4d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "API key found and looks good so far!\n" + ] + } + ], "source": [ "# Load environment variables in a file called .env\n", "\n", @@ -153,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3", "metadata": {}, "outputs": [], @@ -174,10 +182,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "a58394bf-1e45-46af-9bfd-01e24da6f49a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello! Welcome! I'm glad you're here and I'm excited to chat with you. How can I assist you today?\n" + ] + } + ], "source": [ "# To give you a preview -- calling OpenAI with these messages is this easy. Any problems, head over to the Troubleshooting notebook.\n", "\n", @@ -196,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "c5e793b2-6775-426a-a139-4848291d0463", "metadata": {}, "outputs": [], @@ -226,10 +242,65 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "2ef960cf-6dc2-4cda-afb3-b38be12f4c97", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Home - Edward Donner\n", + "Home\n", + "Connect Four\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "Well, hi there.\n", + "I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n", + "very\n", + "amateur) and losing myself in\n", + "Hacker News\n", + ", nodding my head sagely to things I only half understand.\n", + "I’m the co-founder and CTO of\n", + "Nebula.io\n", + ". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n", + "acquired in 2021\n", + ".\n", + "We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n", + "patented\n", + "our matching model, and our award-winning platform has happy customers and tons of press coverage.\n", + "Connect\n", + "with me for more!\n", + "January 23, 2025\n", + "LLM Workshop – Hands-on with Agents – resources\n", + "December 21, 2024\n", + "Welcome, SuperDataScientists!\n", + "November 13, 2024\n", + "Mastering AI and LLM Engineering – Resources\n", + "October 16, 2024\n", + "From Software Engineer to AI Data Scientist – resources\n", + "Navigation\n", + "Home\n", + "Connect Four\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "Get in touch\n", + "ed [at] edwarddonner [dot] com\n", + "www.edwarddonner.com\n", + "Follow me\n", + "LinkedIn\n", + "Twitter\n", + "Facebook\n", + "Subscribe to newsletter\n", + "Type your email…\n", + "Subscribe\n" + ] + } + ], "source": [ "# Let's try one out. Change the website and add print statements to follow along.\n", "\n", @@ -258,7 +329,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "abdb8417-c5dc-44bc-9bee-2e059d162699", "metadata": {}, "outputs": [], @@ -272,7 +343,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c", "metadata": {}, "outputs": [], @@ -290,10 +361,67 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "26448ec4-5c00-4204-baec-7df91d11ff2e", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You are looking at a website titled Home - Edward Donner\n", + "The contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\n", + "\n", + "Home\n", + "Connect Four\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "Well, hi there.\n", + "I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n", + "very\n", + "amateur) and losing myself in\n", + "Hacker News\n", + ", nodding my head sagely to things I only half understand.\n", + "I’m the co-founder and CTO of\n", + "Nebula.io\n", + ". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n", + "acquired in 2021\n", + ".\n", + "We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n", + "patented\n", + "our matching model, and our award-winning platform has happy customers and tons of press coverage.\n", + "Connect\n", + "with me for more!\n", + "January 23, 2025\n", + "LLM Workshop – Hands-on with Agents – resources\n", + "December 21, 2024\n", + "Welcome, SuperDataScientists!\n", + "November 13, 2024\n", + "Mastering AI and LLM Engineering – Resources\n", + "October 16, 2024\n", + "From Software Engineer to AI Data Scientist – resources\n", + "Navigation\n", + "Home\n", + "Connect Four\n", + "Outsmart\n", + "An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n", + "About\n", + "Posts\n", + "Get in touch\n", + "ed [at] edwarddonner [dot] com\n", + "www.edwarddonner.com\n", + "Follow me\n", + "LinkedIn\n", + "Twitter\n", + "Facebook\n", + "Subscribe to newsletter\n", + "Type your email…\n", + "Subscribe\n" + ] + } + ], "source": [ "print(user_prompt_for(ed))" ] @@ -319,7 +447,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5", "metadata": {}, "outputs": [], @@ -332,10 +460,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "21ed95c5-7001-47de-a36d-1d6673b403ce", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Oh, a math whiz in the making! The answer is 4. You're welcome.\n" + ] + } + ], "source": [ "# To give you a preview -- calling OpenAI with system and user messages:\n", "\n", @@ -353,7 +489,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "0134dfa4-8299-48b5-b444-f2a8c3403c88", "metadata": {}, "outputs": [], @@ -369,10 +505,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "36478464-39ee-485c-9f3f-6a4e458dbc9c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[{'role': 'system',\n", + " 'content': 'You are an assistant that analyzes the contents of a website and provides a short summary, ignoring text that might be navigation related. Respond in markdown.'},\n", + " {'role': 'user',\n", + " 'content': 'You are looking at a website titled Home - Edward Donner\\nThe contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\\n\\nHome\\nConnect Four\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nWell, hi there.\\nI’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\\nvery\\namateur) and losing myself in\\nHacker News\\n, nodding my head sagely to things I only half understand.\\nI’m the co-founder and CTO of\\nNebula.io\\n. We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\\nacquired in 2021\\n.\\nWe work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\\npatented\\nour matching model, and our award-winning platform has happy customers and tons of press coverage.\\nConnect\\nwith me for more!\\nJanuary 23, 2025\\nLLM Workshop – Hands-on with Agents – resources\\nDecember 21, 2024\\nWelcome, SuperDataScientists!\\nNovember 13, 2024\\nMastering AI and LLM Engineering – Resources\\nOctober 16, 2024\\nFrom Software Engineer to AI Data Scientist – resources\\nNavigation\\nHome\\nConnect Four\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nGet in touch\\ned [at] edwarddonner [dot] com\\nwww.edwarddonner.com\\nFollow me\\nLinkedIn\\nTwitter\\nFacebook\\nSubscribe to newsletter\\nType your email…\\nSubscribe'}]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# Try this out, and then try for a few more websites\n", "\n", @@ -389,7 +539,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "905b9919-aba7-45b5-ae65-81b3d1d78e34", "metadata": {}, "outputs": [], @@ -407,10 +557,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "05e38d41-dfa4-4b20-9c96-c46ea75d9fb5", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "\"# Summary of Edward Donner's Website\\n\\nEdward Donner's website serves as a personal platform where he shares his interests in coding, experimentation with Large Language Models (LLMs), and other hobbies including DJing and music production. As the co-founder and CTO of Nebula.io, he focuses on applying AI to enhance talent discovery and engagement. Previously, he founded the AI startup untapt, which was acquired in 2021. \\n\\nThe site features several posts with resources related to LLM workshops and AI engineering:\\n\\n- **January 23, 2025**: LLM Workshop – Hands-on with Agents – resources\\n- **December 21, 2024**: Welcome, SuperDataScientists!\\n- **November 13, 2024**: Mastering AI and LLM Engineering – Resources\\n- **October 16, 2024**: From Software Engineer to AI Data Scientist – resources\\n\\nThe content highlights his expertise and invites others to connect with him.\"" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "summarize(\"https://edwarddonner.com\")" ] @@ -418,6 +579,14 @@ { "cell_type": "code", "execution_count": null, + "id": "81079eca", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 18, "id": "3d926d59-450e-4609-92ba-2d6f244f1342", "metadata": {}, "outputs": [], @@ -431,10 +600,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "id": "3018853a-445f-41ff-9560-d925d1774b2f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "# Summary of Edward Donner's Website\n", + "\n", + "Edward Donner's website showcases his passion for coding and experimentation with Large Language Models (LLMs). He is the co-founder and CTO of Nebula.io, a company focused on utilizing AI to help people discover their potential, particularly in the recruitment sector. Previously, he founded the AI startup untapt, which was acquired in 2021.\n", + "\n", + "## Recent Updates\n", + "- **January 23, 2025**: Resources for an LLM Workshop focused on hands-on experience with agents were made available.\n", + "- **December 21, 2024**: A welcoming message for \"SuperDataScientists\" was posted.\n", + "- **November 13, 2024**: Resources for \"Mastering AI and LLM Engineering\" were shared.\n", + "- **October 16, 2024**: Resources aimed at transitioning from software engineering to AI data science were released. \n", + "\n", + "Edward encourages connection and interaction regarding his work and interests in AI and LLMs." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "display_summary(\"https://edwarddonner.com\")" ] @@ -457,22 +649,77 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "id": "45d83403-a24c-44b5-84ac-961449b4008f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "# Summary of CNN's Website Content\n", + "\n", + "The CNN website provides comprehensive coverage of breaking news in various categories, including U.S. and world news, politics, business, health, entertainment, sports, science, and climate. Key highlights include:\n", + "\n", + "### Current News and Updates:\n", + "- **Israel-Hamas War**: Palestinians have held significant anti-Hamas protests in Gaza.\n", + "- **Ukraine-Russia War**: Analysis of timelines regarding conflicts and strategies.\n", + "- **Trump Administration**: Multiple reports on lawsuits involving past cabinet members and legal issues arising from communications in group chats.\n", + "\n", + "### Notable Stories:\n", + "- A 93-year-old woman showcased a sharper cognitive ability than many younger individuals, explained by Dr. Sanjay Gupta.\n", + "- A doctor in Hawaii was arrested for attempting to harm his wife during a hiking trip.\n", + "- Former Brazilian President Bolsonaro is set to stand trial on coup charges, as judicial systems respond to the ongoing political turmoil in various regions.\n", + "\n", + "### Business News:\n", + "- Student loan delinquencies are projected to rise, potentially affecting over 9 million borrowers.\n", + "- Dollar Tree is discontinuing the Family Dollar brand after facing challenges with its integration.\n", + "\n", + "### Entertainment Highlights:\n", + "- Gwyneth Paltrow has addressed a social media feud concerning Meghan Markle.\n", + "- A newly opened restaurant concept in Scranton celebrates the popular show \"The Office\".\n", + "\n", + "### Sports Updates:\n", + "- Analysis on the latest trades and injuries affecting teams as different sports seasons progress.\n", + "\n", + "The site also features various multimedia options including live TV broadcasts, podcasts on a wide range of topics, and personalized content based on user engagement. CNN emphasizes its role as a leading source for in-depth reporting on critical global events and trends." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "display_summary(\"https://cnn.com\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "id": "75e9fd40-b354-4341-991e-863ef2e59db7", "metadata": {}, - "outputs": [], - "source": [ - "display_summary(\"https://anthropic.com\")" + "outputs": [ + { + "data": { + "text/markdown": [ + "# Website Summary: Portfolio\n", + "\n", + "The website titled \"Portfolio\" appears to be a personal or professional showcase, but it cannot function properly without JavaScript enabled. As a result, no content beyond this notice can be accessed or summarized. \n", + "\n", + "No news or announcements are provided on the site." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "display_summary(\"https://iryna-kryvokhyzha.netlify.app/\")" ] }, { @@ -516,12 +763,20 @@ "source": [ "# Step 1: Create your prompts\n", "\n", - "system_prompt = \"something here\"\n", + "system_prompt = \"You are an assistant that analyzes the contents of an email \\\n", + "and suggests an appropriate short subject line for the email. \\\n", + "Respond in markdown.\"\n", "user_prompt = \"\"\"\n", " Lots of text\n", " Can be pasted here\n", "\"\"\"\n", - "\n", + "def user_prompt_for(website):\n", + " user_prompt = f\"You are looking at a website titled {website.title}\"\n", + " user_prompt += \"\\nThe contents of this website is as follows; \\\n", + "please provide a short summary of this website in markdown. \\\n", + "If it includes news or announcements, then summarize these too.\\n\\n\"\n", + " user_prompt += website.text\n", + " return user_prompt\n", "# Step 2: Make the messages list\n", "\n", "messages = [] # fill this in\n", @@ -571,7 +826,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "llms", "language": "python", "name": "python3" }, diff --git a/week1/day5.ipynb b/week1/day5.ipynb index 2d02cdf..30a47bc 100644 --- a/week1/day5.ipynb +++ b/week1/day5.ipynb @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "d5b08506-dc8b-4443-9201-5f1848161363", "metadata": {}, "outputs": [], @@ -42,10 +42,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "fc5d8880-f2ee-4c06-af16-ecbc0262af61", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "API key looks good so far\n" + ] + } + ], "source": [ "# Initialize and constants\n", "\n", @@ -63,7 +71,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "106dd65e-90af-4ca8-86b6-23a41840645b", "metadata": {}, "outputs": [], @@ -101,13 +109,110 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "e30d8128-933b-44cc-81c8-ab4c9d86589a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "['/',\n", + " '/',\n", + " '/advancing-ai/why-ai/',\n", + " '/advancing-ai/milestones',\n", + " '/advancing-ai/research/',\n", + " '/advancing-ai/social-impact/',\n", + " '/advancing-ai/why-ai/',\n", + " '/advancing-ai/milestones',\n", + " '/advancing-ai/research/',\n", + " '/advancing-ai/social-impact/',\n", + " '/responsibility/principles/',\n", + " '/responsibility/safety/',\n", + " '/responsibility/public-policy-perspectives/',\n", + " '/responsibility/building-for-everyone/',\n", + " '/responsibility/principles/',\n", + " '/responsibility/safety/',\n", + " '/responsibility/public-policy-perspectives/',\n", + " '/responsibility/building-for-everyone/',\n", + " '/get-started/gemini-ecosystem/',\n", + " '/get-started/products/',\n", + " 'https://labs.google/',\n", + " '/get-started/for-developers/',\n", + " '/get-started/our-models/',\n", + " '/get-started/for-organizations/',\n", + " '/get-started/gemini-ecosystem/',\n", + " '/get-started/products/',\n", + " 'https://labs.google/',\n", + " '/get-started/for-developers/',\n", + " '/get-started/our-models/',\n", + " '/get-started/for-organizations/',\n", + " '/applied-ai/health/',\n", + " '/applied-ai/science/',\n", + " '/applied-ai/sustainability/',\n", + " 'https://quantumai.google/',\n", + " '/applied-ai/health/',\n", + " '/applied-ai/science/',\n", + " '/applied-ai/sustainability/',\n", + " 'https://quantumai.google/',\n", + " '/latest-news/',\n", + " '/get-started/gemini-ecosystem/',\n", + " '#section-1',\n", + " '#section-2',\n", + " '#section-3',\n", + " '#section-4',\n", + " 'https://deepmind.google/technologies/project-astra/',\n", + " 'https://gemini.google.com/',\n", + " 'https://search.google/ai-on-search/',\n", + " 'https://notebooklm.google/?utm_source=gono&utm_medium=web&utm_campaign=aigooglepage',\n", + " 'https://workspace.google.com/solutions/ai/',\n", + " 'https://aitestkitchen.withgoogle.com/tools/image-fx',\n", + " 'https://blog.google/products/photos/google-ask-photos-early-access/',\n", + " 'https://store.google.com/intl/en/ideas/articles/what-is-an-ai-camera/',\n", + " 'https://aloud.area120.google.com/?utm_source=redirect&utm_medium=aloudai&utm_campaign=0817',\n", + " 'https://grow.google/career-dreamer?utm_source=google&utm_medium=owned&utm_campaign=2025-career-dreamer__geo--Global&utm_content=ai-google-homepage-carousel',\n", + " '/get-started/gemini-ecosystem',\n", + " '/get-started/gemini-ecosystem',\n", + " 'https://www.android.com/ai/',\n", + " '/get-started/for-developers',\n", + " '/get-started/for-organizations',\n", + " '/responsibility/principles/',\n", + " '/responsibility/principles/#our-ai-principles-in-action',\n", + " '/advancing-ai/social-impact/',\n", + " '/advancing-ai/social-impact/',\n", + " 'https://deepmind.google/technologies/alphafold/',\n", + " 'https://sites.research.google/relate/',\n", + " 'https://blog.google/technology/research/google-ai-research-new-images-human-brain/',\n", + " 'https://deepmind.google/discover/blog/graphcast-ai-model-for-faster-and-more-accurate-global-weather-forecasting/',\n", + " 'https://deepmind.google/technologies/alphafold/',\n", + " 'https://sites.research.google/relate/',\n", + " 'https://blog.google/technology/research/google-ai-research-new-images-human-brain/',\n", + " 'https://deepmind.google/discover/blog/graphcast-ai-model-for-faster-and-more-accurate-global-weather-forecasting/',\n", + " '/advancing-ai/milestones/',\n", + " 'https://blog.google/technology/ai/?utm_source=ai.google&utm_medium=referral&utm_campaign=og',\n", + " 'https://blog.google/products/gemini/tips-how-to-use-deep-research/?utm_source=ai.google&utm_medium=referral&utm_campaign=og',\n", + " 'https://blog.google/products/gemini/gemini-collaboration-features/?utm_source=ai.google&utm_medium=referral&utm_campaign=og',\n", + " 'https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025?utm_source=ai.google&utm_medium=referral&utm_campaign=og',\n", + " 'https://blog.google/technology/developers/gemma-3/?utm_source=ai.google&utm_medium=referral&utm_campaign=og',\n", + " 'https://blog.google/technology/health/the-check-up-health-ai-updates-2025/?utm_source=ai.google&utm_medium=referral&utm_campaign=og',\n", + " 'https://deepmind.google/',\n", + " 'https://research.google/',\n", + " 'https://cloud.google.com/?hl=en',\n", + " 'https://labs.google/',\n", + " 'https://www.google.com',\n", + " 'https://www.google.com/intl/en/policies/privacy/',\n", + " 'https://www.google.com/intl/en/policies/terms/',\n", + " 'https://about.google/',\n", + " 'https://about.google/products/']" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "ed = Website(\"https://edwarddonner.com\")\n", - "ed.links" + "site = Website(\"https://ai.google/\")\n", + "site.links" ] }, { @@ -128,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "6957b079-0d96-45f7-a26a-3487510e9b35", "metadata": {}, "outputs": [], @@ -141,7 +246,7 @@ "{\n", " \"links\": [\n", " {\"type\": \"about page\", \"url\": \"https://full.url/goes/here/about\"},\n", - " {\"type\": \"careers page\": \"url\": \"https://another.full.url/careers\"}\n", + " {\"type\": \"careers page\", \"url\": \"https://another.full.url/careers\"}\n", " ]\n", "}\n", "\"\"\"" @@ -149,17 +254,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "b97e4068-97ed-4120-beae-c42105e4d59a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You are provided with a list of links found on a webpage. You are able to decide which of the links would be most relevant to include in a brochure about the company, such as links to an About page, or a Company page, or Careers/Jobs pages.\n", + "You should respond in JSON as in this example:\n", + "{\n", + " \"links\": [\n", + " {\"type\": \"about page\", \"url\": \"https://full.url/goes/here/about\"},\n", + " {\"type\": \"careers page\", \"url\": \"https://another.full.url/careers\"}\n", + " ]\n", + "}\n", + "\n" + ] + } + ], "source": [ "print(link_system_prompt)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "8e1f601b-2eaf-499d-b6b8-c99050c9d6b3", "metadata": {}, "outputs": [], @@ -175,17 +296,113 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "6bcbfa78-6395-4685-b92c-22d592050fd7", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Here is the list of links on the website of https://ai.google/ - please decide which of these are relevant web links for a brochure about the company, respond with the full https URL in JSON format. Do not include Terms of Service, Privacy, email links.\n", + "Links (some might be relative links):\n", + "/\n", + "/\n", + "/advancing-ai/why-ai/\n", + "/advancing-ai/milestones\n", + "/advancing-ai/research/\n", + "/advancing-ai/social-impact/\n", + "/advancing-ai/why-ai/\n", + "/advancing-ai/milestones\n", + "/advancing-ai/research/\n", + "/advancing-ai/social-impact/\n", + "/responsibility/principles/\n", + "/responsibility/safety/\n", + "/responsibility/public-policy-perspectives/\n", + "/responsibility/building-for-everyone/\n", + "/responsibility/principles/\n", + "/responsibility/safety/\n", + "/responsibility/public-policy-perspectives/\n", + "/responsibility/building-for-everyone/\n", + "/get-started/gemini-ecosystem/\n", + "/get-started/products/\n", + "https://labs.google/\n", + "/get-started/for-developers/\n", + "/get-started/our-models/\n", + "/get-started/for-organizations/\n", + "/get-started/gemini-ecosystem/\n", + "/get-started/products/\n", + "https://labs.google/\n", + "/get-started/for-developers/\n", + "/get-started/our-models/\n", + "/get-started/for-organizations/\n", + "/applied-ai/health/\n", + "/applied-ai/science/\n", + "/applied-ai/sustainability/\n", + "https://quantumai.google/\n", + "/applied-ai/health/\n", + "/applied-ai/science/\n", + "/applied-ai/sustainability/\n", + "https://quantumai.google/\n", + "/latest-news/\n", + "/get-started/gemini-ecosystem/\n", + "#section-1\n", + "#section-2\n", + "#section-3\n", + "#section-4\n", + "https://deepmind.google/technologies/project-astra/\n", + "https://gemini.google.com/\n", + "https://search.google/ai-on-search/\n", + "https://notebooklm.google/?utm_source=gono&utm_medium=web&utm_campaign=aigooglepage\n", + "https://workspace.google.com/solutions/ai/\n", + "https://aitestkitchen.withgoogle.com/tools/image-fx\n", + "https://blog.google/products/photos/google-ask-photos-early-access/\n", + "https://store.google.com/intl/en/ideas/articles/what-is-an-ai-camera/\n", + "https://aloud.area120.google.com/?utm_source=redirect&utm_medium=aloudai&utm_campaign=0817\n", + "https://grow.google/career-dreamer?utm_source=google&utm_medium=owned&utm_campaign=2025-career-dreamer__geo--Global&utm_content=ai-google-homepage-carousel\n", + "/get-started/gemini-ecosystem\n", + "/get-started/gemini-ecosystem\n", + "https://www.android.com/ai/\n", + "/get-started/for-developers\n", + "/get-started/for-organizations\n", + "/responsibility/principles/\n", + "/responsibility/principles/#our-ai-principles-in-action\n", + "/advancing-ai/social-impact/\n", + "/advancing-ai/social-impact/\n", + "https://deepmind.google/technologies/alphafold/\n", + "https://sites.research.google/relate/\n", + "https://blog.google/technology/research/google-ai-research-new-images-human-brain/\n", + "https://deepmind.google/discover/blog/graphcast-ai-model-for-faster-and-more-accurate-global-weather-forecasting/\n", + "https://deepmind.google/technologies/alphafold/\n", + "https://sites.research.google/relate/\n", + "https://blog.google/technology/research/google-ai-research-new-images-human-brain/\n", + "https://deepmind.google/discover/blog/graphcast-ai-model-for-faster-and-more-accurate-global-weather-forecasting/\n", + "/advancing-ai/milestones/\n", + "https://blog.google/technology/ai/?utm_source=ai.google&utm_medium=referral&utm_campaign=og\n", + "https://blog.google/products/gemini/tips-how-to-use-deep-research/?utm_source=ai.google&utm_medium=referral&utm_campaign=og\n", + "https://blog.google/products/gemini/gemini-collaboration-features/?utm_source=ai.google&utm_medium=referral&utm_campaign=og\n", + "https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025?utm_source=ai.google&utm_medium=referral&utm_campaign=og\n", + "https://blog.google/technology/developers/gemma-3/?utm_source=ai.google&utm_medium=referral&utm_campaign=og\n", + "https://blog.google/technology/health/the-check-up-health-ai-updates-2025/?utm_source=ai.google&utm_medium=referral&utm_campaign=og\n", + "https://deepmind.google/\n", + "https://research.google/\n", + "https://cloud.google.com/?hl=en\n", + "https://labs.google/\n", + "https://www.google.com\n", + "https://www.google.com/intl/en/policies/privacy/\n", + "https://www.google.com/intl/en/policies/terms/\n", + "https://about.google/\n", + "https://about.google/products/\n" + ] + } + ], "source": [ - "print(get_links_user_prompt(ed))" + "print(get_links_user_prompt(site))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "a29aca19-ca13-471c-a4b4-5abbfa813f69", "metadata": {}, "outputs": [], @@ -206,10 +423,102 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "74a827a0-2782-4ae5-b210-4a242a8b4cc2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "['/',\n", + " '/models',\n", + " '/datasets',\n", + " '/spaces',\n", + " '/posts',\n", + " '/docs',\n", + " '/enterprise',\n", + " '/pricing',\n", + " '/login',\n", + " '/join',\n", + " '/spaces',\n", + " '/models',\n", + " '/deepseek-ai/DeepSeek-V3-0324',\n", + " '/Qwen/Qwen2.5-Omni-7B',\n", + " '/manycore-research/SpatialLM-Llama-1B',\n", + " '/ByteDance/InfiniteYou',\n", + " '/ds4sd/SmolDocling-256M-preview',\n", + " '/models',\n", + " '/spaces/ByteDance/InfiniteYou-FLUX',\n", + " '/spaces/3DAIGC/LHM',\n", + " '/spaces/Trudy/gemini-codrawing',\n", + " '/spaces/tencent/Hunyuan-T1',\n", + " '/spaces/stabilityai/stable-virtual-camera',\n", + " '/spaces',\n", + " '/datasets/nvidia/Llama-Nemotron-Post-Training-Dataset-v1',\n", + " '/datasets/glaiveai/reasoning-v1-20m',\n", + " '/datasets/FreedomIntelligence/medical-o1-reasoning-SFT',\n", + " '/datasets/a-m-team/AM-DeepSeek-R1-Distilled-1.4M',\n", + " '/datasets/facebook/collaborative_agent_bench',\n", + " '/datasets',\n", + " '/join',\n", + " '/pricing#endpoints',\n", + " '/pricing#spaces',\n", + " '/pricing',\n", + " '/enterprise',\n", + " '/enterprise',\n", + " '/enterprise',\n", + " '/enterprise',\n", + " '/enterprise',\n", + " '/enterprise',\n", + " '/enterprise',\n", + " '/allenai',\n", + " '/facebook',\n", + " '/amazon',\n", + " '/google',\n", + " '/Intel',\n", + " '/microsoft',\n", + " '/grammarly',\n", + " '/Writer',\n", + " '/docs/transformers',\n", + " '/docs/diffusers',\n", + " '/docs/safetensors',\n", + " '/docs/huggingface_hub',\n", + " '/docs/tokenizers',\n", + " '/docs/trl',\n", + " '/docs/transformers.js',\n", + " '/docs/smolagents',\n", + " '/docs/peft',\n", + " '/docs/datasets',\n", + " '/docs/text-generation-inference',\n", + " '/docs/accelerate',\n", + " '/models',\n", + " '/datasets',\n", + " '/spaces',\n", + " '/tasks',\n", + " 'https://ui.endpoints.huggingface.co',\n", + " '/chat',\n", + " '/huggingface',\n", + " '/brand',\n", + " '/terms-of-service',\n", + " '/privacy',\n", + " 'https://apply.workable.com/huggingface/',\n", + " 'mailto:press@huggingface.co',\n", + " '/learn',\n", + " '/docs',\n", + " '/blog',\n", + " 'https://discuss.huggingface.co',\n", + " 'https://status.huggingface.co/',\n", + " 'https://github.com/huggingface',\n", + " 'https://twitter.com/huggingface',\n", + " 'https://www.linkedin.com/company/huggingface/',\n", + " '/join/discord']" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# Anthropic has made their site harder to scrape, so I'm using HuggingFace..\n", "\n", @@ -219,10 +528,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "d3d583e2-dcc4-40cc-9b28-1e8dbf402924", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'links': [{'type': 'about page', 'url': 'https://huggingface.co/huggingface'},\n", + " {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'},\n", + " {'type': 'enterprise page', 'url': 'https://huggingface.co/enterprise'},\n", + " {'type': 'pricing page', 'url': 'https://huggingface.co/pricing'},\n", + " {'type': 'blog page', 'url': 'https://huggingface.co/blog'},\n", + " {'type': 'models page', 'url': 'https://huggingface.co/models'},\n", + " {'type': 'datasets page', 'url': 'https://huggingface.co/datasets'},\n", + " {'type': 'spaces page', 'url': 'https://huggingface.co/spaces'},\n", + " {'type': 'documentation page', 'url': 'https://huggingface.co/docs'}]}" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "get_links(\"https://huggingface.co\")" ] @@ -239,7 +567,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "id": "85a5b6e2-e7ef-44a9-bc7f-59ede71037b5", "metadata": {}, "outputs": [], @@ -257,17 +585,3032 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "id": "5099bd14-076d-4745-baf3-dac08d8e5ab2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.co/huggingface'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'enterprise page', 'url': 'https://huggingface.co/enterprise'}, {'type': 'pricing page', 'url': 'https://huggingface.co/pricing'}, {'type': 'blog page', 'url': 'https://huggingface.co/blog'}, {'type': 'models page', 'url': 'https://huggingface.co/models'}, {'type': 'datasets page', 'url': 'https://huggingface.co/datasets'}, {'type': 'spaces page', 'url': 'https://huggingface.co/spaces'}]}\n", + "Landing page:\n", + "Webpage Title:\n", + "Hugging Face – The AI community building the future.\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "The AI community building the future.\n", + "The platform where the machine learning community collaborates on models, datasets, and applications.\n", + "Explore AI Apps\n", + "or\n", + "Browse 1M+ models\n", + "Trending on\n", + "this week\n", + "Models\n", + "deepseek-ai/DeepSeek-V3-0324\n", + "Updated\n", + "1 day ago\n", + "•\n", + "47.6k\n", + "•\n", + "1.91k\n", + "Qwen/Qwen2.5-Omni-7B\n", + "Updated\n", + "about 2 hours ago\n", + "•\n", + "16.3k\n", + "•\n", + "712\n", + "manycore-research/SpatialLM-Llama-1B\n", + "Updated\n", + "7 days ago\n", + "•\n", + "6.85k\n", + "•\n", + "760\n", + "ByteDance/InfiniteYou\n", + "Updated\n", + "3 days ago\n", + "•\n", + "448\n", + "ds4sd/SmolDocling-256M-preview\n", + "Updated\n", + "5 days ago\n", + "•\n", + "44.8k\n", + "•\n", + "1.01k\n", + "Browse 1M+ models\n", + "Spaces\n", + "Running\n", + "on\n", + "Zero\n", + "493\n", + "493\n", + "InfiniteYou-FLUX\n", + "📸\n", + "Flexible Photo Recrafting While Preserving Your Identity\n", + "Running\n", + "on\n", + "Zero\n", + "211\n", + "211\n", + "LHM\n", + "⚡\n", + "Large Animatable Human Model\n", + "Running\n", + "331\n", + "331\n", + "Gemini Co-Drawing\n", + "✏\n", + "Gemini 2.0 native image generation co-doodling\n", + "Running\n", + "167\n", + "167\n", + "Hunyuan T1\n", + "💬\n", + "Hunyuan T1模型体验\n", + "Running\n", + "on\n", + "L40S\n", + "328\n", + "328\n", + "Stable Virtual Camera\n", + "⚡\n", + "Generate virtual camera views from input images\n", + "Browse 400k+ applications\n", + "Datasets\n", + "nvidia/Llama-Nemotron-Post-Training-Dataset-v1\n", + "Updated\n", + "10 days ago\n", + "•\n", + "7.64k\n", + "•\n", + "258\n", + "glaiveai/reasoning-v1-20m\n", + "Updated\n", + "9 days ago\n", + "•\n", + "6.31k\n", + "•\n", + "119\n", + "FreedomIntelligence/medical-o1-reasoning-SFT\n", + "Updated\n", + "Feb 22\n", + "•\n", + "26.3k\n", + "•\n", + "568\n", + "a-m-team/AM-DeepSeek-R1-Distilled-1.4M\n", + "Updated\n", + "about 3 hours ago\n", + "•\n", + "2.98k\n", + "•\n", + "72\n", + "facebook/collaborative_agent_bench\n", + "Updated\n", + "9 days ago\n", + "•\n", + "89\n", + "•\n", + "47\n", + "Browse 250k+ datasets\n", + "The Home of Machine Learning\n", + "Create, discover and collaborate on ML better.\n", + "The collaboration platform\n", + "Host and collaborate on unlimited public models, datasets and applications.\n", + "Move faster\n", + "With the HF Open source stack.\n", + "Explore all modalities\n", + "Text, image, video, audio or even 3D.\n", + "Build your portfolio\n", + "Share your work with the world and build your ML profile.\n", + "Sign Up\n", + "Accelerate your ML\n", + "We provide paid Compute and Enterprise solutions.\n", + "Compute\n", + "Deploy on optimized\n", + "Inference Endpoints\n", + "or update your\n", + "Spaces applications\n", + "to a GPU in a few clicks.\n", + "View pricing\n", + "Starting at $0.60/hour for GPU\n", + "Enterprise\n", + "Give your team the most advanced platform to build AI with enterprise-grade security, access controls and\n", + "\t\t\tdedicated support.\n", + "Getting started\n", + "Starting at $20/user/month\n", + "Single Sign-On\n", + "Regions\n", + "Priority Support\n", + "Audit Logs\n", + "Resource Groups\n", + "Private Datasets Viewer\n", + "More than 50,000 organizations are using Hugging Face\n", + "Ai2\n", + "Enterprise\n", + "non-profit\n", + "•\n", + "396 models\n", + "•\n", + "2.97k followers\n", + "AI at Meta\n", + "Enterprise\n", + "company\n", + "•\n", + "2.07k models\n", + "•\n", + "5.28k followers\n", + "Amazon\n", + "company\n", + "•\n", + "10 models\n", + "•\n", + "2.91k followers\n", + "Google\n", + "company\n", + "•\n", + "974 models\n", + "•\n", + "10.6k followers\n", + "Intel\n", + "company\n", + "•\n", + "219 models\n", + "•\n", + "2.37k followers\n", + "Microsoft\n", + "company\n", + "•\n", + "365 models\n", + "•\n", + "10.7k followers\n", + "Grammarly\n", + "Enterprise\n", + "company\n", + "•\n", + "10 models\n", + "•\n", + "146 followers\n", + "Writer\n", + "Enterprise\n", + "company\n", + "•\n", + "21 models\n", + "•\n", + "253 followers\n", + "Our Open Source\n", + "We are building the foundation of ML tooling with the community.\n", + "Transformers\n", + "142,079\n", + "State-of-the-art ML for PyTorch, TensorFlow, JAX\n", + "Diffusers\n", + "28,301\n", + "State-of-the-art Diffusion models in PyTorch\n", + "Safetensors\n", + "3,189\n", + "Safe way to store/distribute neural network weights\n", + "Hub Python Library\n", + "2,471\n", + "Python client to interact with the Hugging Face Hub\n", + "Tokenizers\n", + "9,538\n", + "Fast tokenizers optimized for research & production\n", + "TRL\n", + "12,895\n", + "Train transformers LMs with reinforcement learning\n", + "Transformers.js\n", + "13,312\n", + "State-of-the-art ML running directly in your browser\n", + "smolagents\n", + "15,929\n", + "Smol library to build great agents in Python\n", + "PEFT\n", + "17,930\n", + "Parameter-efficient finetuning for large language models\n", + "Datasets\n", + "19,892\n", + "Access & share datasets for any ML tasks\n", + "Text Generation Inference\n", + "9,938\n", + "Serve language models with TGI optimized toolkit\n", + "Accelerate\n", + "8,544\n", + "Train PyTorch models with multi-GPU, TPU, mixed precision\n", + "System theme\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Tasks\n", + "Inference Endpoints\n", + "HuggingChat\n", + "Company\n", + "About\n", + "Brand assets\n", + "Terms of service\n", + "Privacy\n", + "Jobs\n", + "Press\n", + "Resources\n", + "Learn\n", + "Documentation\n", + "Blog\n", + "Forum\n", + "Service Status\n", + "Social\n", + "GitHub\n", + "Twitter\n", + "LinkedIn\n", + "Discord\n", + "\n", + "\n", + "\n", + "about page\n", + "Webpage Title:\n", + "huggingface (Hugging Face)\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Hugging Face\n", + "Enterprise\n", + "company\n", + "Verified\n", + "https://huggingface.co\n", + "huggingface\n", + "huggingface\n", + "Activity Feed\n", + "Follow\n", + "28,162\n", + "AI & ML interests\n", + "The AI community building the future.\n", + "Recent Activity\n", + "coyotte508\n", + "new\n", + "activity\n", + "34 minutes ago\n", + "huggingface/HuggingDiscussions:\n", + "[FEEDBACK] Notifications\n", + "Wauplin\n", + "updated\n", + "a dataset\n", + "about 1 hour ago\n", + "huggingface/documentation-images\n", + "lysandre\n", + "updated\n", + "a dataset\n", + "about 2 hours ago\n", + "huggingface/transformers-metadata\n", + "View all activity\n", + "Articles\n", + "Yay! Organizations can now publish blog Articles\n", + "Jan 20\n", + "•\n", + "37\n", + "Team members\n", + "211\n", + "+177\n", + "+164\n", + "+143\n", + "+133\n", + "+113\n", + "Organization Card\n", + "Community\n", + "About org cards\n", + "👋 Hi!\n", + "We are on a mission to democratize\n", + "good\n", + "machine learning, one commit at a time.\n", + "If that sounds like something you should be doing, why don't you\n", + "join us\n", + "!\n", + "For press enquiries, you can\n", + "✉️ contact our team here\n", + ".\n", + "Collections\n", + "1\n", + "DistilBERT release\n", + "Original DistilBERT model, checkpoints obtained from using teacher-student learning from the original BERT checkpoints.\n", + "distilbert/distilbert-base-cased\n", + "Fill-Mask\n", + "•\n", + "Updated\n", + "May 6, 2024\n", + "•\n", + "495k\n", + "•\n", + "•\n", + "38\n", + "distilbert/distilbert-base-uncased\n", + "Fill-Mask\n", + "•\n", + "Updated\n", + "May 6, 2024\n", + "•\n", + "11.9M\n", + "•\n", + "•\n", + "653\n", + "distilbert/distilbert-base-multilingual-cased\n", + "Fill-Mask\n", + "•\n", + "Updated\n", + "May 6, 2024\n", + "•\n", + "2.33M\n", + "•\n", + "•\n", + "182\n", + "distilbert/distilbert-base-uncased-finetuned-sst-2-english\n", + "Text Classification\n", + "•\n", + "Updated\n", + "Dec 19, 2023\n", + "•\n", + "7.07M\n", + "•\n", + "•\n", + "720\n", + "spaces\n", + "26\n", + "Sort: \n", + "\t\tRecently updated\n", + "pinned\n", + "Running\n", + "77\n", + "Number Tokenization Blog\n", + "📈\n", + "Explore how tokenization affects arithmetic in LLMs\n", + "huggingface\n", + "Dec 14, 2024\n", + "Running\n", + "Space Build\n", + "🐨\n", + "Generate static files for spaces\n", + "huggingface\n", + "about 4 hours ago\n", + "Running\n", + "6\n", + "InferenceSupport\n", + "💥\n", + "Discussions about the Inference Providers feature on the Hub\n", + "huggingface\n", + "1 day ago\n", + "Running\n", + "134\n", + "Inference Playground\n", + "🔋\n", + "Set webpage theme based on user preference or system settings\n", + "huggingface\n", + "2 days ago\n", + "Running\n", + "347\n", + "AI Deadlines\n", + "⚡\n", + "Schedule tasks efficiently using AI-generated deadlines\n", + "huggingface\n", + "13 days ago\n", + "Running\n", + "533\n", + "Open Source Ai Year In Review 2024\n", + "😻\n", + "What happened in open-source AI this year, and what’s next?\n", + "huggingface\n", + "Jan 8\n", + "Expand 26\n", + "\t\t\t\t\t\t\tspaces\n", + "models\n", + "16\n", + "Sort: \n", + "\t\tRecently updated\n", + "huggingface/timesfm-tourism-monthly\n", + "Updated\n", + "Dec 9, 2024\n", + "•\n", + "268\n", + "•\n", + "1\n", + "huggingface/CodeBERTa-language-id\n", + "Text Classification\n", + "•\n", + "Updated\n", + "Mar 29, 2024\n", + "•\n", + "7.14k\n", + "•\n", + "•\n", + "59\n", + "huggingface/falcon-40b-gptq\n", + "Text Generation\n", + "•\n", + "Updated\n", + "Jun 14, 2023\n", + "•\n", + "19\n", + "•\n", + "12\n", + "huggingface/autoformer-tourism-monthly\n", + "Updated\n", + "May 24, 2023\n", + "•\n", + "41.2k\n", + "•\n", + "9\n", + "huggingface/distilbert-base-uncased-finetuned-mnli\n", + "Text Classification\n", + "•\n", + "Updated\n", + "Mar 22, 2023\n", + "•\n", + "231\n", + "•\n", + "•\n", + "2\n", + "huggingface/informer-tourism-monthly\n", + "Updated\n", + "Feb 24, 2023\n", + "•\n", + "40.6k\n", + "•\n", + "6\n", + "huggingface/time-series-transformer-tourism-monthly\n", + "Updated\n", + "Feb 23, 2023\n", + "•\n", + "4.87k\n", + "•\n", + "20\n", + "huggingface/the-no-branch-repo\n", + "Text-to-Image\n", + "•\n", + "Updated\n", + "Feb 10, 2023\n", + "•\n", + "23\n", + "•\n", + "4\n", + "huggingface/CodeBERTa-small-v1\n", + "Fill-Mask\n", + "•\n", + "Updated\n", + "Jun 27, 2022\n", + "•\n", + "36.3k\n", + "•\n", + "80\n", + "huggingface/test-model-repo\n", + "Updated\n", + "Nov 19, 2021\n", + "•\n", + "1\n", + "Expand 16\n", + "\t\t\t\t\t\t\tmodels\n", + "datasets\n", + "42\n", + "Sort: \n", + "\t\tRecently updated\n", + "huggingface/documentation-images\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 1 hour ago\n", + "•\n", + "52\n", + "•\n", + "4.33M\n", + "•\n", + "55\n", + "huggingface/transformers-metadata\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 2 hours ago\n", + "•\n", + "1.59k\n", + "•\n", + "1.86k\n", + "•\n", + "19\n", + "huggingface/policy-docs\n", + "Updated\n", + "8 days ago\n", + "•\n", + "2.64k\n", + "•\n", + "10\n", + "huggingface/diffusers-metadata\n", + "Viewer\n", + "•\n", + "Updated\n", + "13 days ago\n", + "•\n", + "69\n", + "•\n", + "612\n", + "•\n", + "6\n", + "huggingface/gemini-results-2025-03-03\n", + "Viewer\n", + "•\n", + "Updated\n", + "25 days ago\n", + "•\n", + "17\n", + "•\n", + "60\n", + "huggingface/gemini-results-2025-02-28\n", + "Viewer\n", + "•\n", + "Updated\n", + "28 days ago\n", + "•\n", + "21\n", + "•\n", + "53\n", + "huggingface/gemini-results-2025-02-27\n", + "Viewer\n", + "•\n", + "Updated\n", + "28 days ago\n", + "•\n", + "24\n", + "•\n", + "57\n", + "huggingface/gemini-results-2025-02-25\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 1 month ago\n", + "•\n", + "32\n", + "•\n", + "62\n", + "huggingface/gemini-results-2025-02-24\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 25\n", + "•\n", + "32\n", + "•\n", + "63\n", + "huggingface/gemini-results-2025-02-21\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 22\n", + "•\n", + "29\n", + "•\n", + "154\n", + "•\n", + "1\n", + "Expand 42\n", + "\t\t\t\t\t\t\tdatasets\n", + "System theme\n", + "Company\n", + "TOS\n", + "Privacy\n", + "About\n", + "Jobs\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Pricing\n", + "Docs\n", + "\n", + "\n", + "\n", + "careers page\n", + "Webpage Title:\n", + "Hugging Face - Current Openings\n", + "Webpage Contents:\n", + "\n", + "\n", + "\n", + "\n", + "enterprise page\n", + "Webpage Title:\n", + "Enterprise Hub - Hugging Face\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Enterprise Hub\n", + "Enterprise-ready version of the world’s leading AI platform\n", + "Subscribe to\n", + "Enterprise Hub\n", + "for $20/user/month with your Hub organization\n", + "Give your organization the most advanced platform to build AI with enterprise-grade security, access controls,\n", + "\t\t\tdedicated support and more.\n", + "Single Sign-On\n", + "Connect securely to your identity provider with SSO integration.\n", + "Regions\n", + "Select, manage, and audit the location of your repository data.\n", + "Audit Logs\n", + "Stay in control with comprehensive logs that report on actions taken.\n", + "Resource Groups\n", + "Accurately manage access to repositories with granular access control.\n", + "Token Management\n", + "Centralized token control and custom approval policies for organization access.\n", + "Analytics\n", + "Track and analyze repository usage data in a single dashboard.\n", + "Advanced Compute Options\n", + "Increase scalability and performance with more compute options like ZeroGPU.\n", + "ZeroGPU Quota Boost\n", + "All organization members get 5x more ZeroGPU quota to get the most of Spaces.\n", + "Private Datasets Viewer\n", + "Enable the Dataset Viewer on your private datasets for easier collaboration.\n", + "Advanced security\n", + "Configure organization-wide security policies and default repository visibility.\n", + "Billing\n", + "Control your budget effectively with managed billing and yearly commit options.\n", + "Priority Support\n", + "Maximize your platform usage with priority support from the Hugging Face team.\n", + "Extra Private Storage\n", + "Get an additional 1 TB of private storage for each member of your organization (then $25/month per extra TB).\n", + "Join the most forward-thinking AI organizations\n", + "Everything you already know and love about Hugging Face in Enterprise mode.\n", + "Subscribe to\n", + "Enterprise Hub\n", + "or\n", + "Talk to sales\n", + "NVIDIA\n", + "Enterprise\n", + "company\n", + "•\n", + "329 models\n", + "•\n", + "20.3k followers\n", + "Nerdy Face\n", + "Enterprise\n", + "company\n", + "•\n", + "1 model\n", + "•\n", + "286 followers\n", + "AMD\n", + "Enterprise\n", + "company\n", + "•\n", + "100 models\n", + "•\n", + "1.43k followers\n", + "Arm\n", + "Enterprise\n", + "company\n", + "•\n", + "159 followers\n", + "ServiceNow-AI\n", + "Enterprise\n", + "company\n", + "•\n", + "194 followers\n", + "Fidelity Investments\n", + "Enterprise\n", + "company\n", + "•\n", + "132 followers\n", + "Mistral AI_\n", + "Enterprise\n", + "company\n", + "•\n", + "26 models\n", + "•\n", + "7.14k followers\n", + "Technology Innovation Institute\n", + "Enterprise\n", + "company\n", + "•\n", + "65 models\n", + "•\n", + "1.27k followers\n", + "Chegg Inc\n", + "Enterprise\n", + "company\n", + "•\n", + "84 followers\n", + "Grammarly\n", + "Enterprise\n", + "company\n", + "•\n", + "10 models\n", + "•\n", + "146 followers\n", + "Arcee AI\n", + "Enterprise\n", + "company\n", + "•\n", + "156 models\n", + "•\n", + "477 followers\n", + "Widn AI\n", + "Enterprise\n", + "company\n", + "•\n", + "43 followers\n", + "Adyen\n", + "Enterprise\n", + "company\n", + "•\n", + "57 followers\n", + "Ekimetrics\n", + "Enterprise\n", + "company\n", + "•\n", + "55 followers\n", + "Meta Llama\n", + "Enterprise\n", + "company\n", + "•\n", + "57 models\n", + "•\n", + "34.1k followers\n", + "Snowflake\n", + "Enterprise\n", + "company\n", + "•\n", + "15 models\n", + "•\n", + "466 followers\n", + "Orange\n", + "Enterprise\n", + "company\n", + "•\n", + "7 models\n", + "•\n", + "198 followers\n", + "Writer\n", + "Enterprise\n", + "company\n", + "•\n", + "21 models\n", + "•\n", + "253 followers\n", + "Deutsche Telekom AG\n", + "Enterprise\n", + "company\n", + "•\n", + "7 models\n", + "•\n", + "135 followers\n", + "Jusbrasil\n", + "Enterprise\n", + "company\n", + "•\n", + "89 followers\n", + "TNG Technology Consulting GmbH\n", + "Enterprise\n", + "company\n", + "•\n", + "1 model\n", + "•\n", + "65 followers\n", + "IBM Granite\n", + "Enterprise\n", + "company\n", + "•\n", + "94 models\n", + "•\n", + "1.33k followers\n", + "creditkarma\n", + "Enterprise\n", + "company\n", + "•\n", + "53 followers\n", + "HiddenLayer\n", + "Enterprise\n", + "company\n", + "•\n", + "1 model\n", + "•\n", + "65 followers\n", + "MiniMax\n", + "Enterprise\n", + "company\n", + "•\n", + "2 models\n", + "•\n", + "594 followers\n", + "BCG X\n", + "Enterprise\n", + "company\n", + "•\n", + "37 followers\n", + "Kakao Corp.\n", + "Enterprise\n", + "company\n", + "•\n", + "3 models\n", + "•\n", + "109 followers\n", + "Twelve Labs\n", + "Enterprise\n", + "company\n", + "•\n", + "40 followers\n", + "Shopify\n", + "Enterprise\n", + "company\n", + "•\n", + "429 followers\n", + "AI at Meta\n", + "Enterprise\n", + "company\n", + "•\n", + "2.07k models\n", + "•\n", + "5.28k followers\n", + "Together\n", + "Enterprise\n", + "company\n", + "•\n", + "32 models\n", + "•\n", + "550 followers\n", + "Xsolla\n", + "Enterprise\n", + "company\n", + "•\n", + "120 followers\n", + "Toyota Research Institute\n", + "Enterprise\n", + "company\n", + "•\n", + "10 models\n", + "•\n", + "104 followers\n", + "Mercedes-Benz AG\n", + "Enterprise\n", + "company\n", + "•\n", + "142 followers\n", + "H2O.ai\n", + "Enterprise\n", + "company\n", + "•\n", + "72 models\n", + "•\n", + "407 followers\n", + "Aledade Inc\n", + "Enterprise\n", + "company\n", + "•\n", + "64 followers\n", + "Nutanix\n", + "Enterprise\n", + "company\n", + "•\n", + "262 models\n", + "•\n", + "65 followers\n", + "Johnson & Johnson\n", + "Enterprise\n", + "company\n", + "•\n", + "56 followers\n", + "Stability AI\n", + "Enterprise\n", + "company\n", + "•\n", + "104 models\n", + "•\n", + "19.6k followers\n", + "Liquid AI\n", + "Enterprise\n", + "company\n", + "•\n", + "116 followers\n", + "Gretel.ai\n", + "Enterprise\n", + "company\n", + "•\n", + "9 models\n", + "•\n", + "112 followers\n", + "NewMindAI\n", + "Enterprise\n", + "company\n", + "•\n", + "36 followers\n", + "Compliance & Certifications\n", + "GDPR Compliant\n", + "SOC 2 Type 2\n", + "System theme\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Tasks\n", + "Inference Endpoints\n", + "HuggingChat\n", + "Company\n", + "About\n", + "Brand assets\n", + "Terms of service\n", + "Privacy\n", + "Jobs\n", + "Press\n", + "Resources\n", + "Learn\n", + "Documentation\n", + "Blog\n", + "Forum\n", + "Service Status\n", + "Social\n", + "GitHub\n", + "Twitter\n", + "LinkedIn\n", + "Discord\n", + "\n", + "\n", + "\n", + "pricing page\n", + "Webpage Title:\n", + "Hugging Face – Pricing\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Pricing\n", + "Leveling up AI collaboration and compute.\n", + "Users and organizations already use the Hub as a collaboration platform,\n", + "we’re making it easy to seamlessly and scalably launch ML compute directly from the Hub.\n", + "HF Hub\n", + "Collaborate on Machine Learning\n", + "Host unlimited public models, datasets\n", + "Create unlimited orgs with no member limits\n", + "Access the latest ML tools and open source\n", + "Community support\n", + "Forever\n", + "Free\n", + "PRO\n", + "Pro Account\n", + "Unlock advanced HF features\n", + "ZeroGPU and Dev Mode for Spaces\n", + "Free credits across all Inference Providers\n", + "Get early access to upcoming features\n", + "Show your support with a Pro badge\n", + "Subscribe for\n", + "$9\n", + "/month\n", + "Enterprise Hub\n", + "Accelerate your AI roadmap\n", + "SSO and SAML support\n", + "Select data location with Storage Regions\n", + "Precise actions reviews with Audit logs\n", + "Granular access control with Resource groups\n", + "Centralized token control and approval\n", + "Dataset Viewer for private datasets\n", + "Advanced compute options for Spaces\n", + "5x more ZeroGPU quota for all org members\n", + "Deploy Inference on your own Infra\n", + "Managed billing with yearly commits\n", + "Priority support\n", + "Starting at\n", + "$20\n", + "per user per month\n", + "Spaces Hardware\n", + "Upgrade your Space compute\n", + "Free CPUs\n", + "Build more advanced Spaces\n", + "7 optimized hardware available\n", + "From CPU to GPU to Accelerators\n", + "Starting at\n", + "$0\n", + "/hour\n", + "Inference Endpoints\n", + "Deploy models on fully managed infrastructure\n", + "Deploy dedicated Endpoints in seconds\n", + "Keep your costs low\n", + "Fully-managed autoscaling\n", + "Enterprise security\n", + "Starting at\n", + "$0.032\n", + "/hour\n", + "Need support to accelerate AI in your organization? View our\n", + "Expert Support\n", + ".\n", + "Hugging Face Hub\n", + "free\n", + "The HF Hub is the central place to explore, experiment, collaborate and build technology with Machine\n", + "\t\t\t\t\tLearning.\n", + "Join the open source Machine Learning movement!\n", + "→\n", + "Sign Up\n", + "Create with ML\n", + "Packed with ML features, like model eval, dataset viewer and much more.\n", + "Collaborate\n", + "Git based and designed for collaboration at its core.\n", + "Play and learn\n", + "Learn by experimenting and sharing with our awesome community.\n", + "Build your ML portfolio\n", + "Share your work with the world and build your own ML profile.\n", + "Spaces Hardware\n", + "Starting at $0\n", + "Spaces are one of the most popular ways to share ML applications and demos with the world.\n", + "Upgrade your Spaces with our selection of custom on-demand hardware:\n", + "→\n", + "Get started with Spaces\n", + "Name\n", + "CPU\n", + "Memory\n", + "Accelerator\n", + "VRAM\n", + "Hourly price\n", + "CPU Basic\n", + "2 vCPU\n", + "16 GB\n", + "-\n", + "-\n", + "FREE\n", + "CPU Upgrade\n", + "8 vCPU\n", + "32 GB\n", + "-\n", + "-\n", + "$0.03\n", + "Nvidia T4 - small\n", + "4 vCPU\n", + "15 GB\n", + "Nvidia T4\n", + "16 GB\n", + "$0.40\n", + "Nvidia T4 - medium\n", + "8 vCPU\n", + "30 GB\n", + "Nvidia T4\n", + "16 GB\n", + "$0.60\n", + "1x Nvidia L4\n", + "8 vCPU\n", + "30 GB\n", + "Nvidia L4\n", + "24 GB\n", + "$0.80\n", + "4x Nvidia L4\n", + "48 vCPU\n", + "186 GB\n", + "Nvidia L4\n", + "96 GB\n", + "$3.80\n", + "1x Nvidia L40S\n", + "8 vCPU\n", + "62 GB\n", + "Nvidia L4\n", + "48 GB\n", + "$1.80\n", + "4x Nvidia L40S\n", + "48 vCPU\n", + "382 GB\n", + "Nvidia L4\n", + "192 GB\n", + "$8.30\n", + "8x Nvidia L40S\n", + "192 vCPU\n", + "1534 GB\n", + "Nvidia L4\n", + "384 GB\n", + "$23.50\n", + "Nvidia A10G - small\n", + "4 vCPU\n", + "15 GB\n", + "Nvidia A10G\n", + "24 GB\n", + "$1.00\n", + "Nvidia A10G - large\n", + "12 vCPU\n", + "46 GB\n", + "Nvidia A10G\n", + "24 GB\n", + "$1.50\n", + "2x Nvidia A10G - large\n", + "24 vCPU\n", + "92 GB\n", + "Nvidia A10G\n", + "48 GB\n", + "$3.00\n", + "4x Nvidia A10G - large\n", + "48 vCPU\n", + "184 GB\n", + "Nvidia A10G\n", + "96 GB\n", + "$5.00\n", + "Nvidia A100 - large\n", + "12 vCPU\n", + "142 GB\n", + "Nvidia A100\n", + "80 GB\n", + "$4.00\n", + "TPU v5e 1x1\n", + "22 vCPU\n", + "44 GB\n", + "Google TPU v5e\n", + "16 GB\n", + "$1.20\n", + "TPU v5e 2x2\n", + "110 vCPU\n", + "186 GB\n", + "Google TPU v5e\n", + "64 GB\n", + "$4.75\n", + "TPU v5e 2x4\n", + "220 vCPU\n", + "380 GB\n", + "Google TPU v5e\n", + "128 GB\n", + "$9.50\n", + "Custom\n", + "on demand\n", + "on demand\n", + "on demand\n", + "on demand\n", + "on demand\n", + "Spaces Persistent Storage\n", + "All Spaces get ephemeral storage for free but you can upgrade and add persistent storage at any time.\n", + "Name\n", + "Storage\n", + "Monthly price\n", + "Small\n", + "20 GB\n", + "$5\n", + "Medium\n", + "150 GB\n", + "$25\n", + "Large\n", + "1 TB\n", + "$100\n", + "Building something cool as a side project? We also offer community GPU grants.\n", + "Inference Endpoints\n", + "Starting at $0.033/hour\n", + "Inference Endpoints (dedicated) offers a secure production solution to easily deploy any ML model on dedicated\n", + "\t\t\t\t\tand autoscaling infrastructure, right from the HF Hub.\n", + "→\n", + "Learn more\n", + "CPU\n", + "instances\n", + "Provider\n", + "Architecture\n", + "vCPUs\n", + "Memory\n", + "Hourly rate\n", + "aws\n", + "Intel Sapphire Rapids\n", + "1\n", + "2GB\n", + "$0.03\n", + "2\n", + "4GB\n", + "$0.07\n", + "4\n", + "8GB\n", + "$0.13\n", + "8\n", + "16GB\n", + "$0.27\n", + "16\n", + "32GB\n", + "$0.54\n", + "azure\n", + "Intel Xeon\n", + "1\n", + "2GB\n", + "$0.06\n", + "2\n", + "4GB\n", + "$0.12\n", + "4\n", + "8GB\n", + "$0.24\n", + "8\n", + "16GB\n", + "$0.48\n", + "gcp\n", + "Intel Sapphire Rapids\n", + "1\n", + "2GB\n", + "$0.05\n", + "2\n", + "4GB\n", + "$0.10\n", + "4\n", + "8GB\n", + "$0.20\n", + "8\n", + "16GB\n", + "$0.40\n", + "Accelerator\n", + "instances\n", + "Provider\n", + "Architecture\n", + "Topology\n", + "Accelerator Memory\n", + "Hourly rate\n", + "aws\n", + "Inf2\n", + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNeuron\n", + "x1\n", + "14.5GB\n", + "$0.75\n", + "x12\n", + "760GB\n", + "$12.00\n", + "gcp\n", + "TPU\n", + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tv5e\n", + "1x1\n", + "16GB\n", + "$1.20\n", + "2x2\n", + "64GB\n", + "$4.75\n", + "2x4\n", + "128GB\n", + "$9.50\n", + "GPU\n", + "instances\n", + "Provider\n", + "Architecture\n", + "GPUs\n", + "GPU Memory\n", + "Hourly rate\n", + "aws\n", + "NVIDIA T4\n", + "1\n", + "14GB\n", + "$0.50\n", + "4\n", + "56GB\n", + "$3.00\n", + "aws\n", + "NVIDIA L4\n", + "1\n", + "24GB\n", + "$0.80\n", + "4\n", + "96GB\n", + "$3.80\n", + "aws\n", + "NVIDIA L40S\n", + "1\n", + "48GB\n", + "$1.80\n", + "4\n", + "192GB\n", + "$8.30\n", + "8\n", + "384GB\n", + "$23.50\n", + "aws\n", + "NVIDIA A10G\n", + "1\n", + "24GB\n", + "$1.00\n", + "4\n", + "96GB\n", + "$5.00\n", + "aws\n", + "NVIDIA A100\n", + "1\n", + "80GB\n", + "$4.00\n", + "2\n", + "160GB\n", + "$8.00\n", + "4\n", + "320GB\n", + "$16.00\n", + "8\n", + "640GB\n", + "$32.00\n", + "gcp\n", + "NVIDIA T4\n", + "1\n", + "16GB\n", + "$0.50\n", + "gcp\n", + "NVIDIA L4\n", + "1\n", + "24GB\n", + "$0.70\n", + "4\n", + "96GB\n", + "$3.80\n", + "gcp\n", + "NVIDIA A100\n", + "1\n", + "80GB\n", + "$3.60\n", + "2\n", + "160GB\n", + "$7.20\n", + "4\n", + "320GB\n", + "$14.40\n", + "8\n", + "640GB\n", + "$28.80\n", + "gcp\n", + "NVIDIA H100\n", + "1\n", + "80GB\n", + "$10.00\n", + "2\n", + "160GB\n", + "$20.00\n", + "4\n", + "320GB\n", + "$40.00\n", + "8\n", + "640GB\n", + "$80.00\n", + "Pro Account\n", + "PRO\n", + "A monthly subscription to access powerful features.\n", + "→\n", + "Get Pro\n", + "($9/month)\n", + "ZeroGPU\n", + ": Get 5x usage quota and highest GPU queue priority\n", + "Spaces Hosting\n", + ": Create ZeroGPU Spaces with A100 hardware\n", + "Spaces Dev Mode\n", + ": Fast iterations via SSH/VS Code for Spaces\n", + "Inference Providers\n", + ": Get $2 included credits across all Inference Providers\n", + "Dataset Viewer\n", + ": Activate it on private datasets\n", + "Blog Articles\n", + ": Publish articles to the Hugging Face blog\n", + "Social Posts\n", + ": Share short updates with the community\n", + "Features Preview\n", + ": Get early access to upcoming\n", + "\t\t\t\t\t\t\t\t\t\tfeatures\n", + "PRO\n", + "Badge\n", + ":\n", + "\t\t\t\t\t\t\t\t\t\tShow your support on your profile\n", + "System theme\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Tasks\n", + "Inference Endpoints\n", + "HuggingChat\n", + "Company\n", + "About\n", + "Brand assets\n", + "Terms of service\n", + "Privacy\n", + "Jobs\n", + "Press\n", + "Resources\n", + "Learn\n", + "Documentation\n", + "Blog\n", + "Forum\n", + "Service Status\n", + "Social\n", + "GitHub\n", + "Twitter\n", + "LinkedIn\n", + "Discord\n", + "\n", + "\n", + "\n", + "blog page\n", + "Webpage Title:\n", + "Hugging Face – Blog\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Blog, Articles, and discussions\n", + "New Article\n", + "Everything\n", + "community\n", + "guide\n", + "open source collab\n", + "partnerships\n", + "research\n", + "NLP\n", + "Audio\n", + "CV\n", + "RL\n", + "ethics\n", + "Diffusion\n", + "Game Development\n", + "RLHF\n", + "Leaderboard\n", + "Case Studies\n", + "LeRobot\n", + "Accelerating LLM Inference with TGI on Intel Gaudi\n", + "By\n", + "baptistecolle\n", + "March 28, 2025\n", + "•\n", + "6\n", + "Community Articles\n", + "view all\n", + "🦸🏻#14: What Is MCP, and Why Is Everyone – Suddenly!– Talking About It?\n", + "By\n", + "Kseniase\n", + "•\n", + "11 days ago\n", + "•\n", + "89\n", + "Open R1: Update #4\n", + "By\n", + "open-r1\n", + "and 3 others\n", + "•\n", + "2 days ago\n", + "•\n", + "34\n", + "Open R1: Update #3\n", + "By\n", + "open-r1\n", + "and 9 others\n", + "•\n", + "17 days ago\n", + "•\n", + "274\n", + "DeepSearch Using Visual RAG in Agentic Frameworks 🔎\n", + "By\n", + "paultltc\n", + "and 1 other\n", + "•\n", + "7 days ago\n", + "•\n", + "28\n", + "I Clicked “I Agree”, But What Am I Really Consenting To?\n", + "By\n", + "giadap\n", + "•\n", + "2 days ago\n", + "•\n", + "19\n", + "Uncensor any LLM with abliteration\n", + "By\n", + "mlabonne\n", + "•\n", + "Jun 13, 2024\n", + "•\n", + "495\n", + "Speeding Up LLM Decoding with Advanced Universal Assisted Generation Techniques\n", + "By\n", + "jmamou\n", + "and 8 others\n", + "•\n", + "4 days ago\n", + "•\n", + "15\n", + "FeeL: Making Multilingual LMs Better, One Feedback Loop at a Time\n", + "By\n", + "borgr\n", + "and 1 other\n", + "•\n", + "3 days ago\n", + "•\n", + "10\n", + "DeepSeek-R1 Dissection: Understanding PPO & GRPO Without Any Prior Reinforcement Learning Knowledge\n", + "By\n", + "NormalUhr\n", + "•\n", + "Feb 7\n", + "•\n", + "89\n", + "ColPali: Efficient Document Retrieval with Vision Language Models 👀\n", + "By\n", + "manu\n", + "•\n", + "Jul 5, 2024\n", + "•\n", + "226\n", + "KV Caching Explained: Optimizing Transformer Inference Efficiency\n", + "By\n", + "not-lain\n", + "•\n", + "Jan 30\n", + "•\n", + "46\n", + "Introducing EuroBERT: A High-Performance Multilingual Encoder Model\n", + "By\n", + "EuroBERT\n", + "and 3 others\n", + "•\n", + "18 days ago\n", + "•\n", + "133\n", + "Understanding and Implementing the Tree of Thoughts Paradigm\n", + "By\n", + "sadhaklal\n", + "•\n", + "2 days ago\n", + "•\n", + "7\n", + "Open-Source Handwritten Signature Detection Model\n", + "By\n", + "samuellimabraz\n", + "•\n", + "14 days ago\n", + "•\n", + "89\n", + "makeMoE: Implement a Sparse Mixture of Experts Language Model from Scratch\n", + "By\n", + "AviSoori1x\n", + "•\n", + "May 7, 2024\n", + "•\n", + "70\n", + "Mastering Tensor Dimensions in Transformers\n", + "By\n", + "not-lain\n", + "•\n", + "Jan 12\n", + "•\n", + "56\n", + "PangolinGuard: Fine-Tuning ModernBERT as a Lightweight Approach to AI Guardrails\n", + "By\n", + "dcarpintero\n", + "•\n", + "5 days ago\n", + "•\n", + "5\n", + "The Large Language Model Course\n", + "By\n", + "mlabonne\n", + "•\n", + "Jan 16\n", + "•\n", + "144\n", + "Manus AI: The Best Autonomous AI Agent Redefining Automation and Productivity\n", + "By\n", + "LLMhacker\n", + "•\n", + "23 days ago\n", + "•\n", + "151\n", + "mistral.rs v0.5.0\n", + "By\n", + "EricB\n", + "•\n", + "5 days ago\n", + "•\n", + "5\n", + "Training and Finetuning Reranker Models with Sentence Transformers v4\n", + "By\n", + "tomaarsen\n", + "March 26, 2025\n", + "•\n", + "60\n", + "Introducing Gradio's new Dataframe!\n", + "By\n", + "hmb\n", + "March 24, 2025\n", + "•\n", + "17\n", + "The New and Fresh analytics in Inference Endpoints\n", + "By\n", + "erikkaum\n", + "March 21, 2025\n", + "•\n", + "17\n", + "Open R1: How to use OlympicCoder locally for coding?\n", + "By\n", + "burtenshaw\n", + "March 20, 2025\n", + "•\n", + "52\n", + "AI Policy: 🤗 Response to the White House AI Action Plan RFI\n", + "By\n", + "yjernite\n", + "March 19, 2025\n", + "•\n", + "21\n", + "NVIDIA's GTC 2025 Announcement for Physical AI Developers: New Open Models and Datasets\n", + "By\n", + "mingyuliutw\n", + "March 18, 2025\n", + "guest\n", + "•\n", + "29\n", + "Xet is on the Hub\n", + "By\n", + "jsulz\n", + "March 18, 2025\n", + "•\n", + "33\n", + "Welcome Gemma 3: Google's all new multimodal, multilingual, long context open LLM\n", + "By\n", + "ariG23498\n", + "March 12, 2025\n", + "•\n", + "352\n", + "LeRobot goes to driving school: World’s largest open-source self-driving dataset\n", + "By\n", + "sandhawalia\n", + "March 11, 2025\n", + "•\n", + "68\n", + "LLM Inference on Edge: A Fun and Easy Guide to run LLMs via React Native on your Phone!\n", + "By\n", + "medmekk\n", + "March 7, 2025\n", + "•\n", + "45\n", + "Hugging Face and JFrog partner to make AI Security more transparent\n", + "By\n", + "mcpotato\n", + "March 4, 2025\n", + "•\n", + "21\n", + "A Deepdive into Aya Vision: Advancing the Frontier of Multilingual Multimodality\n", + "By\n", + "saurabhdash\n", + "March 4, 2025\n", + "guest\n", + "•\n", + "70\n", + "Trace & Evaluate your Agent with Arize Phoenix\n", + "By\n", + "m-ric\n", + "February 28, 2025\n", + "guest\n", + "•\n", + "35\n", + "HuggingFace, IISc partner to supercharge model building on India's diverse languages\n", + "By\n", + "prasantg\n", + "February 27, 2025\n", + "•\n", + "18\n", + "Previous\n", + "1\n", + "2\n", + "3\n", + "...\n", + "40\n", + "Next\n", + "Community Articles\n", + "Sort: \n", + "\t\tTrending\n", + "🦸🏻#14: What Is MCP, and Why Is Everyone – Suddenly!– Talking About It?\n", + "By\n", + "Kseniase\n", + "•\n", + "11 days ago\n", + "•\n", + "89\n", + "Open R1: Update #4\n", + "By\n", + "open-r1\n", + "and 3 others\n", + "•\n", + "2 days ago\n", + "•\n", + "34\n", + "Open R1: Update #3\n", + "By\n", + "open-r1\n", + "and 9 others\n", + "•\n", + "17 days ago\n", + "•\n", + "274\n", + "DeepSearch Using Visual RAG in Agentic Frameworks 🔎\n", + "By\n", + "paultltc\n", + "and 1 other\n", + "•\n", + "7 days ago\n", + "•\n", + "28\n", + "I Clicked “I Agree”, But What Am I Really Consenting To?\n", + "By\n", + "giadap\n", + "•\n", + "2 days ago\n", + "•\n", + "19\n", + "Uncensor any LLM with abliteration\n", + "By\n", + "mlabonne\n", + "•\n", + "Jun 13, 2024\n", + "•\n", + "495\n", + "Speeding Up LLM Decoding with Advanced Universal Assisted Generation Techniques\n", + "By\n", + "jmamou\n", + "and 8 others\n", + "•\n", + "4 days ago\n", + "•\n", + "15\n", + "FeeL: Making Multilingual LMs Better, One Feedback Loop at a Time\n", + "By\n", + "borgr\n", + "and 1 other\n", + "•\n", + "3 days ago\n", + "•\n", + "10\n", + "DeepSeek-R1 Dissection: Understanding PPO & GRPO Without Any Prior Reinforcement Learning Knowledge\n", + "By\n", + "NormalUhr\n", + "•\n", + "Feb 7\n", + "•\n", + "89\n", + "ColPali: Efficient Document Retrieval with Vision Language Models 👀\n", + "By\n", + "manu\n", + "•\n", + "Jul 5, 2024\n", + "•\n", + "226\n", + "KV Caching Explained: Optimizing Transformer Inference Efficiency\n", + "By\n", + "not-lain\n", + "•\n", + "Jan 30\n", + "•\n", + "46\n", + "Introducing EuroBERT: A High-Performance Multilingual Encoder Model\n", + "By\n", + "EuroBERT\n", + "and 3 others\n", + "•\n", + "18 days ago\n", + "•\n", + "133\n", + "Understanding and Implementing the Tree of Thoughts Paradigm\n", + "By\n", + "sadhaklal\n", + "•\n", + "2 days ago\n", + "•\n", + "7\n", + "Open-Source Handwritten Signature Detection Model\n", + "By\n", + "samuellimabraz\n", + "•\n", + "14 days ago\n", + "•\n", + "89\n", + "makeMoE: Implement a Sparse Mixture of Experts Language Model from Scratch\n", + "By\n", + "AviSoori1x\n", + "•\n", + "May 7, 2024\n", + "•\n", + "70\n", + "Mastering Tensor Dimensions in Transformers\n", + "By\n", + "not-lain\n", + "•\n", + "Jan 12\n", + "•\n", + "56\n", + "PangolinGuard: Fine-Tuning ModernBERT as a Lightweight Approach to AI Guardrails\n", + "By\n", + "dcarpintero\n", + "•\n", + "5 days ago\n", + "•\n", + "5\n", + "The Large Language Model Course\n", + "By\n", + "mlabonne\n", + "•\n", + "Jan 16\n", + "•\n", + "144\n", + "Manus AI: The Best Autonomous AI Agent Redefining Automation and Productivity\n", + "By\n", + "LLMhacker\n", + "•\n", + "23 days ago\n", + "•\n", + "151\n", + "mistral.rs v0.5.0\n", + "By\n", + "EricB\n", + "•\n", + "5 days ago\n", + "•\n", + "5\n", + "View all\n", + "System theme\n", + "Company\n", + "TOS\n", + "Privacy\n", + "About\n", + "Jobs\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Pricing\n", + "Docs\n", + "\n", + "\n", + "\n", + "models page\n", + "Webpage Title:\n", + "Models - Hugging Face\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Edit Models filters\n", + "Tasks\n", + "Libraries\n", + "Datasets\n", + "Languages\n", + "Licenses\n", + "Other\n", + "Multimodal\n", + "Audio-Text-to-Text\n", + "Image-Text-to-Text\n", + "Visual Question Answering\n", + "Document Question Answering\n", + "Video-Text-to-Text\n", + "Visual Document Retrieval\n", + "Any-to-Any\n", + "Computer Vision\n", + "Depth Estimation\n", + "Image Classification\n", + "Object Detection\n", + "Image Segmentation\n", + "Text-to-Image\n", + "Image-to-Text\n", + "Image-to-Image\n", + "Image-to-Video\n", + "Unconditional Image Generation\n", + "Video Classification\n", + "Text-to-Video\n", + "Zero-Shot Image Classification\n", + "Mask Generation\n", + "Zero-Shot Object Detection\n", + "Text-to-3D\n", + "Image-to-3D\n", + "Image Feature Extraction\n", + "Keypoint Detection\n", + "Natural Language Processing\n", + "Text Classification\n", + "Token Classification\n", + "Table Question Answering\n", + "Question Answering\n", + "Zero-Shot Classification\n", + "Translation\n", + "Summarization\n", + "Feature Extraction\n", + "Text Generation\n", + "Text2Text Generation\n", + "Fill-Mask\n", + "Sentence Similarity\n", + "Text Ranking\n", + "Audio\n", + "Text-to-Speech\n", + "Text-to-Audio\n", + "Automatic Speech Recognition\n", + "Audio-to-Audio\n", + "Audio Classification\n", + "Voice Activity Detection\n", + "Tabular\n", + "Tabular Classification\n", + "Tabular Regression\n", + "Time Series Forecasting\n", + "Reinforcement Learning\n", + "Reinforcement Learning\n", + "Robotics\n", + "Other\n", + "Graph Machine Learning\n", + "Apply filters\n", + "Models\n", + "Full-text search\n", + "Add filters\n", + "Sort: \n", + "\t\tTrending\n", + "deepseek-ai/DeepSeek-V3-0324\n", + "Text Generation\n", + "•\n", + "Updated\n", + "1 day ago\n", + "•\n", + "47.6k\n", + "•\n", + "•\n", + "1.91k\n", + "Qwen/Qwen2.5-Omni-7B\n", + "Any-to-Any\n", + "•\n", + "Updated\n", + "about 2 hours ago\n", + "•\n", + "16.3k\n", + "•\n", + "712\n", + "manycore-research/SpatialLM-Llama-1B\n", + "Text Generation\n", + "•\n", + "Updated\n", + "7 days ago\n", + "•\n", + "6.85k\n", + "•\n", + "760\n", + "ByteDance/InfiniteYou\n", + "Text-to-Image\n", + "•\n", + "Updated\n", + "3 days ago\n", + "•\n", + "448\n", + "ds4sd/SmolDocling-256M-preview\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "5 days ago\n", + "•\n", + "44.8k\n", + "•\n", + "1.01k\n", + "sesame/csm-1b\n", + "Text-to-Speech\n", + "•\n", + "Updated\n", + "12 days ago\n", + "•\n", + "53.7k\n", + "•\n", + "•\n", + "1.71k\n", + "starvector/starvector-8b-im2svg\n", + "Text Generation\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "6.24k\n", + "•\n", + "354\n", + "Qwen/Qwen2.5-VL-32B-Instruct\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "2 days ago\n", + "•\n", + "72.7k\n", + "•\n", + "246\n", + "mistralai/Mistral-Small-3.1-24B-Instruct-2503\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "6 days ago\n", + "•\n", + "102k\n", + "•\n", + "1.01k\n", + "deepseek-ai/DeepSeek-R1\n", + "Text Generation\n", + "•\n", + "Updated\n", + "1 day ago\n", + "•\n", + "1.42M\n", + "•\n", + "•\n", + "11.7k\n", + "canopylabs/orpheus-3b-0.1-ft\n", + "Text-to-Speech\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "36.1k\n", + "•\n", + "418\n", + "tencent/Hunyuan3D-2mv\n", + "Image-to-3D\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "7.13k\n", + "•\n", + "348\n", + "Qwen/QwQ-32B\n", + "Text Generation\n", + "•\n", + "Updated\n", + "17 days ago\n", + "•\n", + "688k\n", + "•\n", + "•\n", + "2.56k\n", + "SUFE-AIFLM-Lab/Fin-R1\n", + "Updated\n", + "8 days ago\n", + "•\n", + "893\n", + "•\n", + "155\n", + "google/gemma-3-27b-it\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "7 days ago\n", + "•\n", + "901k\n", + "•\n", + "•\n", + "1.01k\n", + "black-forest-labs/FLUX.1-dev\n", + "Text-to-Image\n", + "•\n", + "Updated\n", + "Aug 16, 2024\n", + "•\n", + "2.8M\n", + "•\n", + "•\n", + "9.57k\n", + "starvector/starvector-1b-im2svg\n", + "Text Generation\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "11.9k\n", + "•\n", + "133\n", + "nvidia/canary-1b-flash\n", + "Automatic Speech Recognition\n", + "•\n", + "Updated\n", + "10 days ago\n", + "•\n", + "8.64k\n", + "•\n", + "156\n", + "unsloth/DeepSeek-V3-0324-GGUF\n", + "Text Generation\n", + "•\n", + "Updated\n", + "2 days ago\n", + "•\n", + "87.7k\n", + "•\n", + "88\n", + "deepseek-ai/DeepSeek-V3\n", + "Text Generation\n", + "•\n", + "Updated\n", + "1 day ago\n", + "•\n", + "1.42M\n", + "•\n", + "•\n", + "3.74k\n", + "teapotai/teapotllm\n", + "Text2Text Generation\n", + "•\n", + "Updated\n", + "2 days ago\n", + "•\n", + "5.03k\n", + "•\n", + "•\n", + "83\n", + "hexgrad/Kokoro-82M\n", + "Text-to-Speech\n", + "•\n", + "Updated\n", + "10 days ago\n", + "•\n", + "1.67M\n", + "•\n", + "3.83k\n", + "nvidia/GR00T-N1-2B\n", + "Robotics\n", + "•\n", + "Updated\n", + "10 days ago\n", + "•\n", + "1.68k\n", + "•\n", + "247\n", + "VIDraft/Gemma-3-R1984-27B\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "about 24 hours ago\n", + "•\n", + "186\n", + "•\n", + "74\n", + "google/gemma-3-4b-it\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "7 days ago\n", + "•\n", + "326k\n", + "•\n", + "357\n", + "microsoft/Phi-4-multimodal-instruct\n", + "Automatic Speech Recognition\n", + "•\n", + "Updated\n", + "about 21 hours ago\n", + "•\n", + "826k\n", + "•\n", + "1.25k\n", + "Qwen/Qwen2.5-VL-7B-Instruct\n", + "Image-Text-to-Text\n", + "•\n", + "Updated\n", + "6 days ago\n", + "•\n", + "3.34M\n", + "•\n", + "•\n", + "751\n", + "stabilityai/stable-virtual-camera\n", + "Image-to-Video\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "8.12k\n", + "•\n", + "147\n", + "stabilityai/stable-diffusion-3.5-large\n", + "Text-to-Image\n", + "•\n", + "Updated\n", + "Oct 22, 2024\n", + "•\n", + "146k\n", + "•\n", + "•\n", + "2.57k\n", + "SicariusSicariiStuff/X-Ray_Alpha\n", + "Updated\n", + "3 days ago\n", + "•\n", + "203\n", + "•\n", + "48\n", + "System theme\n", + "Company\n", + "TOS\n", + "Privacy\n", + "About\n", + "Jobs\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Pricing\n", + "Docs\n", + "\n", + "\n", + "\n", + "datasets page\n", + "Webpage Title:\n", + "Hugging Face – The AI community building the future.\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Edit Datasets filters\n", + "Main\n", + "Tasks\n", + "Libraries\n", + "Languages\n", + "Licenses\n", + "Other\n", + "Modalities\n", + "3D\n", + "Audio\n", + "Geospatial\n", + "Image\n", + "Tabular\n", + "Text\n", + "Time-series\n", + "Video\n", + "Size\n", + "\t\t\t(rows)\n", + "Reset Size\n", + "< 1K\n", + "> 1T\n", + "Format\n", + "json\n", + "csv\n", + "parquet\n", + "imagefolder\n", + "soundfolder\n", + "webdataset\n", + "text\n", + "arrow\n", + "Apply filters\n", + "Datasets\n", + "341,954\n", + "Full-text search\n", + "Add filters\n", + "Sort: \n", + "\t\tTrending\n", + "nvidia/Llama-Nemotron-Post-Training-Dataset-v1\n", + "Viewer\n", + "•\n", + "Updated\n", + "10 days ago\n", + "•\n", + "15.2M\n", + "•\n", + "7.64k\n", + "•\n", + "258\n", + "glaiveai/reasoning-v1-20m\n", + "Viewer\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "22.2M\n", + "•\n", + "6.31k\n", + "•\n", + "119\n", + "FreedomIntelligence/medical-o1-reasoning-SFT\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 22\n", + "•\n", + "50.1k\n", + "•\n", + "26.3k\n", + "•\n", + "568\n", + "a-m-team/AM-DeepSeek-R1-Distilled-1.4M\n", + "Preview\n", + "•\n", + "Updated\n", + "about 3 hours ago\n", + "•\n", + "2.98k\n", + "•\n", + "72\n", + "facebook/collaborative_agent_bench\n", + "Preview\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "89\n", + "•\n", + "47\n", + "PixelAI-Team/TalkBody4D\n", + "Viewer\n", + "•\n", + "Updated\n", + "3 days ago\n", + "•\n", + "1.05M\n", + "•\n", + "60\n", + "•\n", + "40\n", + "nvidia/PhysicalAI-Robotics-GR00T-X-Embodiment-Sim\n", + "Updated\n", + "7 days ago\n", + "•\n", + "26.9k\n", + "•\n", + "88\n", + "manycore-research/SpatialLM-Testset\n", + "Viewer\n", + "•\n", + "Updated\n", + "9 days ago\n", + "•\n", + "107\n", + "•\n", + "6.98k\n", + "•\n", + "43\n", + "Congliu/Chinese-DeepSeek-R1-Distill-data-110k\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 21\n", + "•\n", + "110k\n", + "•\n", + "6.58k\n", + "•\n", + "597\n", + "Anthropic/EconomicIndex\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 19 hours ago\n", + "•\n", + "3.36k\n", + "•\n", + "2.56k\n", + "•\n", + "224\n", + "open-r1/codeforces-cots\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 5 hours ago\n", + "•\n", + "254k\n", + "•\n", + "7.78k\n", + "•\n", + "114\n", + "Intelligent-Internet/II-Thought-RL-v0\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 2 hours ago\n", + "•\n", + "342k\n", + "•\n", + "1.19k\n", + "•\n", + "26\n", + "facebook/natural_reasoning\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 21\n", + "•\n", + "1.15M\n", + "•\n", + "13.6k\n", + "•\n", + "464\n", + "Conard/fortune-telling\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 17\n", + "•\n", + "207\n", + "•\n", + "6.17k\n", + "•\n", + "105\n", + "HuggingFaceFW/fineweb\n", + "Viewer\n", + "•\n", + "Updated\n", + "Jan 31\n", + "•\n", + "25B\n", + "•\n", + "228k\n", + "•\n", + "2.07k\n", + "sychonix/emotion\n", + "Viewer\n", + "•\n", + "Updated\n", + "2 days ago\n", + "•\n", + "20k\n", + "•\n", + "114\n", + "•\n", + "17\n", + "openai/gsm8k\n", + "Viewer\n", + "•\n", + "Updated\n", + "Jan 4, 2024\n", + "•\n", + "17.6k\n", + "•\n", + "334k\n", + "•\n", + "664\n", + "open-thoughts/OpenThoughts-114k\n", + "Viewer\n", + "•\n", + "Updated\n", + "Feb 20\n", + "•\n", + "228k\n", + "•\n", + "33.5k\n", + "•\n", + "672\n", + "zhang0jhon/Aesthetic-4K\n", + "Viewer\n", + "•\n", + "Updated\n", + "4 days ago\n", + "•\n", + "2.7k\n", + "•\n", + "1.38k\n", + "•\n", + "16\n", + "Rapidata/OpenAI-4o_t2i_human_preference\n", + "Viewer\n", + "•\n", + "Updated\n", + "about 3 hours ago\n", + "•\n", + "13k\n", + "•\n", + "257\n", + "•\n", + "15\n", + "fka/awesome-chatgpt-prompts\n", + "Viewer\n", + "•\n", + "Updated\n", + "Jan 6\n", + "•\n", + "203\n", + "•\n", + "12.1k\n", + "•\n", + "7.65k\n", + "starvector/svg-stack\n", + "Viewer\n", + "•\n", + "Updated\n", + "Jan 10\n", + "•\n", + "2.28M\n", + "•\n", + "1.13k\n", + "•\n", + "16\n", + "BytedTsinghua-SIA/DAPO-Math-17k\n", + "Viewer\n", + "•\n", + "Updated\n", + "10 days ago\n", + "•\n", + "1.79M\n", + "•\n", + "2.83k\n", + "•\n", + "45\n", + "nvidia/HelpSteer3\n", + "Viewer\n", + "•\n", + "Updated\n", + "10 days ago\n", + "•\n", + "99k\n", + "•\n", + "897\n", + "•\n", + "32\n", + "MrDragonFox/Elise\n", + "Viewer\n", + "•\n", + "Updated\n", + "1 day ago\n", + "•\n", + "1.2k\n", + "•\n", + "204\n", + "•\n", + "13\n", + "mlabonne/FineTome-100k\n", + "Viewer\n", + "•\n", + "Updated\n", + "Jul 29, 2024\n", + "•\n", + "100k\n", + "•\n", + "19.2k\n", + "•\n", + "192\n", + "MaziyarPanahi/Llama-Nemotron-Post-Training-Dataset-v1-ShareGPT\n", + "Viewer\n", + "•\n", + "Updated\n", + "5 days ago\n", + "•\n", + "30.2M\n", + "•\n", + "924\n", + "•\n", + "28\n", + "fibonacciai/shahname\n", + "Viewer\n", + "•\n", + "Updated\n", + "4 days ago\n", + "•\n", + "99.2k\n", + "•\n", + "35\n", + "•\n", + "12\n", + "fibonacciai/Persian-Wikipedia-QA\n", + "Viewer\n", + "•\n", + "Updated\n", + "4 days ago\n", + "•\n", + "26.5k\n", + "•\n", + "34\n", + "•\n", + "11\n", + "dair-ai/emotion\n", + "Viewer\n", + "•\n", + "Updated\n", + "Aug 8, 2024\n", + "•\n", + "437k\n", + "•\n", + "15.9k\n", + "•\n", + "342\n", + "Previous\n", + "1\n", + "2\n", + "3\n", + "...\n", + "100\n", + "Next\n", + "System theme\n", + "Company\n", + "TOS\n", + "Privacy\n", + "About\n", + "Jobs\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Pricing\n", + "Docs\n", + "\n", + "\n", + "\n", + "spaces page\n", + "Webpage Title:\n", + "Spaces - Hugging Face\n", + "Webpage Contents:\n", + "Hugging Face\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Posts\n", + "Docs\n", + "Enterprise\n", + "Pricing\n", + "Log In\n", + "Sign Up\n", + "Spaces\n", + "·\n", + "The AI App Directory\n", + "New Space\n", + "What is Spaces?\n", + "Image Generation\n", + "Video Generation\n", + "Text Generation\n", + "Language Translation\n", + "Speech Synthesis\n", + "3D Modeling\n", + "Object Detection\n", + "Text Analysis\n", + "Image Editing\n", + "Code Generation\n", + "Question Answering\n", + "Data Visualization\n", + "Voice Cloning\n", + "Background Removal\n", + "Image Upscaling\n", + "OCR\n", + "Document Analysis\n", + "Visual QA\n", + "Image Captioning\n", + "Chatbots\n", + "Sentiment Analysis\n", + "Text Summarization\n", + "Music Generation\n", + "Medical Imaging\n", + "Financial Analysis\n", + "Game AI\n", + "Model Benchmarking\n", + "Fine Tuning Tools\n", + "Dataset Creation\n", + "Pose Estimation\n", + "Face Recognition\n", + "Anomaly Detection\n", + "Recommendation Systems\n", + "Character Animation\n", + "Style Transfer\n", + "Image\n", + "Spaces of the week\n", + "24 Mar 2025\n", + "Sort: \n", + "\t\tRelevance\n", + "Running\n", + "on\n", + "L40S\n", + "115\n", + "Cube3d Interactive\n", + "🌍\n", + "interactive demo for cube 3d model\n", + "Roblox\n", + "7 days ago\n", + "Running\n", + "on\n", + "Zero\n", + "493\n", + "InfiniteYou-FLUX\n", + "📸\n", + "Flexible Photo Recrafting While Preserving Your Identity\n", + "ByteDance\n", + "3 days ago\n", + "Running\n", + "on\n", + "Zero\n", + "201\n", + "SmolDocling\n", + "🦆\n", + "Convert images and text to document formats\n", + "ds4sd\n", + "10 days ago\n", + "Running\n", + "167\n", + "Hunyuan T1\n", + "💬\n", + "Hunyuan T1模型体验\n", + "tencent\n", + "6 days ago\n", + "Running\n", + "331\n", + "Gemini Co-Drawing\n", + "✏\n", + "Gemini 2.0 native image generation co-doodling\n", + "Trudy\n", + "8 days ago\n", + "Running\n", + "62\n", + "Follow History\n", + "🔥\n", + "Track history of Follows of organizations and users on HF\n", + "julien-c\n", + "9 days ago\n", + "Running\n", + "on\n", + "Zero\n", + "108\n", + "Orpheus TTS\n", + "🚀\n", + "Try Orpheus TTS here\n", + "MohamedRashad\n", + "2 days ago\n", + "All running apps, trending first\n", + "Running\n", + "on\n", + "Zero\n", + "493\n", + "InfiniteYou-FLUX\n", + "📸\n", + "Flexible Photo Recrafting While Preserving Your Identity\n", + "ByteDance\n", + "3 days ago\n", + "Running\n", + "on\n", + "Zero\n", + "211\n", + "LHM\n", + "⚡\n", + "Large Animatable Human Model\n", + "3DAIGC\n", + "1 day ago\n", + "Running\n", + "331\n", + "Gemini Co-Drawing\n", + "✏\n", + "Gemini 2.0 native image generation co-doodling\n", + "Trudy\n", + "8 days ago\n", + "Running\n", + "167\n", + "Hunyuan T1\n", + "💬\n", + "Hunyuan T1模型体验\n", + "tencent\n", + "6 days ago\n", + "Running\n", + "on\n", + "L40S\n", + "328\n", + "Stable Virtual Camera\n", + "⚡\n", + "Generate virtual camera views from input images\n", + "stabilityai\n", + "4 days ago\n", + "Running\n", + "141\n", + "starvector-1b-im2svg\n", + "📈\n", + "Convert images and text into scalable vector graphics (SVG) code\n", + "starvector\n", + "3 days ago\n", + "Running\n", + "139\n", + "Qwen2.5 Omni 7B Demo\n", + "🏆\n", + "Submit media inputs to generate text and speech responses\n", + "Qwen\n", + "1 day ago\n", + "Running\n", + "on\n", + "Zero\n", + "4.42k\n", + "TRELLIS\n", + "🏢\n", + "Scalable and Versatile 3D Generation from images\n", + "JeffreyXiang\n", + "Dec 18, 2024\n", + "Running\n", + "on\n", + "Zero\n", + "683\n", + "Sesame CSM\n", + "🌱\n", + "Conversational speech generation\n", + "sesame\n", + "3 days ago\n", + "Running\n", + "113\n", + "Deepseek v3-0324 Research\n", + "🏃\n", + "Deepseek v3-0324 + Real Time Deep Research\n", + "openfree\n", + "about 24 hours ago\n", + "Running\n", + "on\n", + "Zero\n", + "7.98k\n", + "FLUX.1 [dev]\n", + "🖥\n", + "Generate images from text prompts\n", + "black-forest-labs\n", + "Oct 9, 2024\n", + "Running\n", + "on\n", + "L40S\n", + "115\n", + "Cube3d Interactive\n", + "🌍\n", + "interactive demo for cube 3d model\n", + "Roblox\n", + "7 days ago\n", + "Running\n", + "on\n", + "CPU Upgrade\n", + "8.09k\n", + "Kolors Virtual Try-On\n", + "👕\n", + "Overlay garment on person image\n", + "Kwai-Kolors\n", + "Sep 18, 2024\n", + "Running\n", + "on\n", + "Zero\n", + "1.2k\n", + "LuminaBrush\n", + "📈\n", + "Execute custom code from environment variable\n", + "lllyasviel\n", + "Dec 21, 2024\n", + "Running\n", + "on\n", + "Zero\n", + "2.14k\n", + "Hunyuan3D-2.0\n", + "🌍\n", + "Text-to-3D and Image-to-3D Generation\n", + "tencent\n", + "6 days ago\n", + "Running\n", + "on\n", + "L4\n", + "269\n", + "Thera Arbitrary-Scale Super-Resolution\n", + "🔥\n", + "Enhance image quality with real-time super-resolution\n", + "prs-eth\n", + "5 days ago\n", + "Running\n", + "on\n", + "Zero\n", + "3.14k\n", + "IC Light V2\n", + "📈\n", + "Execute code provided in environment variable\n", + "lllyasviel\n", + "Oct 26, 2024\n", + "Running\n", + "on\n", + "Zero\n", + "108\n", + "Orpheus TTS\n", + "🚀\n", + "Try Orpheus TTS here\n", + "MohamedRashad\n", + "2 days ago\n", + "Running\n", + "162\n", + "FLUX - EVERY TEXT Imaginator\n", + "🖼\n", + "FLUX Multilingual Text-Driven Image Generation and Editing\n", + "ginigen\n", + "3 days ago\n", + "Running\n", + "on\n", + "CPU Upgrade\n", + "5.23k\n", + "MTEB Leaderboard\n", + "🥇\n", + "Embedding Leaderboard\n", + "mteb\n", + "about 6 hours ago\n", + "Running\n", + "70\n", + "Deepseek v3-0324 Research korea\n", + "💬\n", + "Deepseek v3-0324 + Real Time Deep Research\n", + "openfree\n", + "3 days ago\n", + "Running\n", + "on\n", + "A100\n", + "67\n", + "Gemma-3-R1984-27B\n", + "🔥\n", + "Reasoning + Multimodal + VLM + Deep Research + Agent\n", + "VIDraft\n", + "about 5 hours ago\n", + "Running\n", + "on\n", + "Zero\n", + "201\n", + "SmolDocling\n", + "🦆\n", + "Convert images and text to document formats\n", + "ds4sd\n", + "10 days ago\n", + "Running\n", + "on\n", + "Zero\n", + "191\n", + "Hunyuan3D 2mv Turbo\n", + "🌍\n", + "MultiImages-to-3D Generation\n", + "tencent\n", + "9 days ago\n", + "System theme\n", + "Company\n", + "TOS\n", + "Privacy\n", + "About\n", + "Jobs\n", + "Website\n", + "Models\n", + "Datasets\n", + "Spaces\n", + "Pricing\n", + "Docs\n", + "\n", + "\n" + ] + } + ], "source": [ "print(get_all_details(\"https://huggingface.co\"))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "id": "9b863a55-f86c-4e3f-8a79-94e24c1a8cf2", "metadata": {}, "outputs": [], @@ -285,7 +3628,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "id": "6ab83d92-d36b-4ce0-8bcc-5bb4c2f8ff23", "metadata": {}, "outputs": [], @@ -300,17 +3643,35 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "id": "cd909e0b-1312-4ce2-a553-821e795d7572", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.co/about'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'company page', 'url': 'https://huggingface.co/enterprise'}, {'type': 'pricing page', 'url': 'https://huggingface.co/pricing'}, {'type': 'blog page', 'url': 'https://huggingface.co/blog'}, {'type': 'discussion forum', 'url': 'https://discuss.huggingface.co'}, {'type': 'social media', 'url': 'https://twitter.com/huggingface'}, {'type': 'LinkedIn profile', 'url': 'https://www.linkedin.com/company/huggingface/'}]}\n" + ] + }, + { + "data": { + "text/plain": [ + "\"You are looking at a company called: HuggingFace\\nHere are the contents of its landing page and other relevant pages; use this information to build a short brochure of the company in markdown.\\nLanding page:\\nWebpage Title:\\nHugging Face – The AI community building the future.\\nWebpage Contents:\\nHugging Face\\nModels\\nDatasets\\nSpaces\\nPosts\\nDocs\\nEnterprise\\nPricing\\nLog In\\nSign Up\\nThe AI community building the future.\\nThe platform where the machine learning community collaborates on models, datasets, and applications.\\nExplore AI Apps\\nor\\nBrowse 1M+ models\\nTrending on\\nthis week\\nModels\\ndeepseek-ai/DeepSeek-V3-0324\\nUpdated\\n1 day ago\\n•\\n47.6k\\n•\\n1.91k\\nQwen/Qwen2.5-Omni-7B\\nUpdated\\nabout 2 hours ago\\n•\\n16.3k\\n•\\n712\\nmanycore-research/SpatialLM-Llama-1B\\nUpdated\\n7 days ago\\n•\\n6.85k\\n•\\n760\\nByteDance/InfiniteYou\\nUpdated\\n3 days ago\\n•\\n448\\nds4sd/SmolDocling-256M-preview\\nUpdated\\n5 days ago\\n•\\n44.8k\\n•\\n1.01k\\nBrowse 1M+ models\\nSpaces\\nRunning\\non\\nZero\\n493\\n493\\nInfiniteYou-FLUX\\n📸\\nFlexible Photo Recrafting While Preserving Your Identity\\nRunning\\non\\nZero\\n211\\n211\\nLHM\\n⚡\\nLarge Animatable Human Model\\nRunning\\n331\\n331\\nGemini Co-Drawing\\n✏\\nGemini 2.0 native image generation co-doodling\\nRunning\\n167\\n167\\nHunyuan T1\\n💬\\nHunyuan T1模型体验\\nRunning\\non\\nL40S\\n328\\n328\\nStable Virtual Camera\\n⚡\\nGenerate virtual camera views from input images\\nBrowse 400k+ applications\\nDatasets\\nnvidia/Llama-Nemotron-Post-Training-Dataset-v1\\nUpdated\\n10 days ago\\n•\\n7.64k\\n•\\n258\\nglaiveai/reasoning-v1-20m\\nUpdated\\n9 days ago\\n•\\n6.31k\\n•\\n119\\nFreedomIntelligence/medical-o1-reasoning-SFT\\nUpdated\\nFeb 22\\n•\\n26.3k\\n•\\n568\\na-m-team/AM-DeepSeek-R1-Distilled-1.4M\\nUpdated\\nabout 3 hours ago\\n•\\n2.98k\\n•\\n72\\nfacebook/collaborative_agent_bench\\nUpdated\\n9 days ago\\n•\\n89\\n•\\n47\\nBrowse 250k+ datasets\\nThe Home of Machine Learning\\nCreate, discover and collaborate on ML better.\\nThe collaboration platform\\nHost and collaborate on unlimited public models, datasets and applications.\\nMove faster\\nWith the HF Open source stack.\\nExplore all modalities\\nText, image, video, audio or even 3D.\\nBuild your portfolio\\nShare your work with the world and build your ML profile.\\nSign Up\\nAccelerate your ML\\nWe provide paid Compute and Enterprise solutions.\\nCompute\\nDeploy on optimized\\nInference Endpoints\\nor update your\\nSpaces applications\\nto a GPU in a few clicks.\\nView pricing\\nStarting at $0.60/hour for GPU\\nEnterprise\\nGive your team the most advanced platform to build AI with enterprise-grade security, access controls and\\n\\t\\t\\tdedicated support.\\nGetting started\\nStarting at $20/user/month\\nSingle Sign-On\\nRegions\\nPriority Support\\nAudit Logs\\nResource Groups\\nPrivate Datasets Viewer\\nMore than 50,000 organizations are using Hugging Face\\nAi2\\nEnterprise\\nnon-profit\\n•\\n396 models\\n•\\n2.97k followers\\nAI at Meta\\nEnterprise\\ncompany\\n•\\n2.07k models\\n•\\n5.28k followers\\nAmazon\\ncompany\\n•\\n10 models\\n•\\n2.91k followers\\nGoogle\\ncompany\\n•\\n974 models\\n•\\n10.6k followers\\nIntel\\ncompany\\n•\\n219 models\\n•\\n2.37k followers\\nMicrosoft\\ncompany\\n•\\n365 models\\n•\\n10.7k followers\\nGrammarly\\nEnterprise\\ncompany\\n•\\n10 models\\n•\\n146 followers\\nWriter\\nEnterprise\\ncompany\\n•\\n21 models\\n•\\n253 followers\\nOur Open Source\\nWe are building the foundation of ML tooling with the community.\\nTransformers\\n142,079\\nState-of-the-art ML for PyTorch, TensorFlow, JAX\\nDiffusers\\n28,301\\nState-of-the-art Diffusion models in PyTorch\\nSafetensors\\n3,189\\nSafe way to store/distribute neural network weights\\nHub Python Library\\n2,471\\nPython client to interact with the Hugging Face Hub\\nTokenizers\\n9,538\\nFast tokenizers optimized for research & production\\nTRL\\n12,895\\nTrain transformers LMs with reinforcement learning\\nTransformers.js\\n13,312\\nState-of-the-art ML running directly in your browser\\nsmolagents\\n15,929\\nSmol library to build great agents in Python\\nPEFT\\n17,930\\nParameter-efficient finetuning for large language models\\nDatasets\\n19,892\\nAccess & share datasets for any ML tasks\\nText Generation Inference\\n9,938\\nServe language models with TGI optimized toolkit\\nAccelerate\\n8,544\\nTrain PyTorch models with multi-GPU, TPU, mixed precision\\nSystem theme\\nWebsite\\nModels\\nDatasets\\nSpaces\\nTasks\\nInference Endpoints\\nHuggingChat\\nCompany\\nAbout\\nBrand assets\\nTerms of service\\nPrivacy\\nJobs\\nPress\\nResources\\nLearn\\nDocumentation\\nBlog\\nForum\\nService Status\\nSocial\\nGitHub\\nTwitter\\nLinkedIn\\nDiscord\\n\\n\\n\\nabout page\\nWebpage Title:\\nabout (Sergei)\\nWebpage Contents:\\nHugging Face\\nModels\\nDatasets\\nSpaces\\nPosts\\nDocs\\nEnterprise\\nPricing\\nLog In\\nSign Up\\nSergei\\nabout\\nFollow\\nAlbertRuan's profile picture\\nselvivincent's profile picture\\nRenumathi's profile picture\\n4\\n\\t\\t\\t\\t\\tfollowers\\n·\\n0 following\\nAI & ML interests\\nNone yet\\nOrganizations\\nNone yet\\nmodels\\nNone public yet\\ndatasets\\nNone public yet\\nSystem theme\\nCompany\\nTOS\\nPrivacy\\nAbout\\nJobs\\nWebsite\\nModels\\nDatasets\\nSpaces\\nPricing\\nDocs\\n\\n\\n\\ncareers page\\nWebpage Title:\\nHugging Face - Current Openings\\nWebpage Contents:\\n\\n\\n\\n\\ncompany page\\nWebpage Title:\\nEnterprise Hub - Hugging Face\\nWebpage Contents:\\nHugging Face\\nModels\\nDatasets\\nSpaces\\nPosts\\nDocs\\nEnterprise\\nPricing\\nLog In\\nSign Up\\nEnterprise Hub\\nEnterprise-ready version of the world’s leading AI platform\\nSubscribe to\\nEnterpris\"" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "get_brochure_user_prompt(\"HuggingFace\", \"https://huggingface.co\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "id": "e44de579-4a1a-4e6a-a510-20ea3e4b8d46", "metadata": {}, "outputs": [], @@ -329,10 +3690,69 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "id": "e093444a-9407-42ae-924a-145730591a39", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.co/huggingface'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'blog page', 'url': 'https://huggingface.co/blog'}, {'type': 'company page', 'url': 'https://www.linkedin.com/company/huggingface/'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "# Hugging Face Brochure\n", + "\n", + "## Welcome to Hugging Face\n", + "\n", + "**Hugging Face** is at the forefront of the artificial intelligence and machine learning revolution, dedicated to building a collaborative community that shapes the future of AI. Our platform is where the machine learning community connects, shares, and innovates—whether it's models, datasets, or applications.\n", + "\n", + "### Why Choose Hugging Face?\n", + "\n", + "- **Extensive Model Library:** Explore and utilize over **1 million% models** across various modalities including text, image, video, audio, and 3D.\n", + "- **Datasets for All:** Access and share more than **250,000 datasets** for your machine learning tasks.\n", + "- **Dedicated Spaces:** Run and showcase **400,000+ applications** in our dedicated spaces.\n", + "- **Open Source Collaboration:** Contribute to cutting-edge tooling and libraries like Transformers, Diffusers, and more within our vibrant community.\n", + "\n", + "### Who We Serve\n", + "\n", + "Hugging Face is trusted by more than **50,000 organizations**, including industry leaders such as:\n", + "- **Google**\n", + "- **Microsoft**\n", + "- **Amazon**\n", + "- **Meta**\n", + "- **Intel**\n", + "- **Grammarly**\n", + "\n", + "### Our Company Culture\n", + "\n", + "At Hugging Face, we foster a **collaborative and inclusive environment** where innovation thrives. Our team is not just about technology; it's about people coming together to share knowledge, support one another, and create meaningful solutions. We promote continuous learning and encourage our team members to contribute ideas that drive the company forward.\n", + "\n", + "### Careers & Opportunities\n", + "\n", + "We are always looking for talent! Join us and become a part of the future of AI. **Explore career opportunities** at Hugging Face to find positions that align with your passion and skills. Whether you're an engineer, researcher, or enthusiast, we welcome diverse skills and perspectives to help shape the future of AI together.\n", + "\n", + "**Interested in joining us? [Find out more about current job openings.](#)**\n", + "\n", + "### Join the AI Revolution\n", + "\n", + "Ready to be part of something bigger? **[Sign up now](#)** to start exploring, collaborating, and innovating. Together, let's build the future of AI!\n", + "\n", + "--- \n", + "\n", + "For more information, visit us at [huggingface.co](https://huggingface.co). Follow us on social media; we're active on GitHub, Twitter, LinkedIn, and more!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "create_brochure(\"HuggingFace\", \"https://huggingface.co\")" ] @@ -350,7 +3770,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "id": "51db0e49-f261-4137-aabe-92dd601f7725", "metadata": {}, "outputs": [], @@ -375,10 +3795,89 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "id": "56bf0ae3-ee9d-4a72-9cd6-edcac67ceb6d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.co/huggingface'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'enterprise page', 'url': 'https://huggingface.co/enterprise'}, {'type': 'pricing page', 'url': 'https://huggingface.co/pricing'}, {'type': 'blog page', 'url': 'https://huggingface.co/blog'}, {'type': 'community page', 'url': 'https://discuss.huggingface.co'}, {'type': 'LinkedIn page', 'url': 'https://www.linkedin.com/company/huggingface/'}]}\n" + ] + }, + { + "data": { + "text/markdown": [ + "# Hugging Face Brochure\n", + "\n", + "---\n", + "\n", + "## Company Overview\n", + "\n", + "**Hugging Face** is the leading platform for the AI community focused on machine learning collaboration. With over one million models available for exploration, Hugging Face serves as a pivotal resource where individuals and organizations can create, discover, and work together on innovative ML projects. The company empowers developers, researchers, and enterprises to accelerate their machine learning endeavors through tools, datasets, and applications designed for a collaborative experience.\n", + "\n", + "---\n", + "\n", + "## Our Offerings\n", + "\n", + "- **Models**: Access a wealth of machine learning models spanning various applications from text to images and beyond.\n", + "- **Datasets**: Browse over 250,000 datasets for all your machine learning needs.\n", + "- **Spaces**: Explore custom applications powered by Hugging Face technology that can run seamlessly on the platform.\n", + "- **Enterprise Solutions**: Optimal for businesses looking for enhanced security, dedicated support, and private resource management, tailored to facilitate advanced AI work.\n", + "\n", + "---\n", + "\n", + "## Who We Serve\n", + "\n", + "Hugging Face caters to a diverse range of customers, including over **50,000 organizations** like:\n", + "\n", + "- **Amazon**\n", + "- **Google**\n", + "- **Meta**\n", + "- **Microsoft**\n", + "\n", + "Our offerings are utilized by non-profits, large enterprises, and individual developers, all drawn to our open-source philosophy and commitment to community collaboration.\n", + "\n", + "---\n", + "\n", + "## Company Culture\n", + "\n", + "At Hugging Face, we believe in **community-driven development**, where everyone contributes to building the future of AI. Our culture emphasizes inclusivity, innovation, and collaboration. We encourage team members to share their ideas and projects, fostering an environment where creativity flourishes.\n", + "\n", + "---\n", + "\n", + "## Careers at Hugging Face\n", + "\n", + "We are always on the lookout for passionate individuals to join our team. Working at Hugging Face offers the opportunity to be part of a pioneering community that is shaping the AI landscape. \n", + "\n", + "**Why Work with Us?**\n", + "- Engage in cutting-edge AI research and development.\n", + "- Collaborate with top industry experts.\n", + "- Contribute to open-source projects impacting the global AI community.\n", + "\n", + "**Open Positions:** Explore current job openings on our [Careers Page](https://huggingface.co/jobs).\n", + "\n", + "---\n", + "\n", + "## Join Us\n", + "\n", + "Are you ready to be part of the AI revolution? Whether you're an individual looking to enhance your ML skills, an organization seeking enterprise solutions, or a potential recruit desiring a dynamic career, *Hugging Face* is your gateway to the future of AI.\n", + "\n", + "**Explore more at:** [Hugging Face Website](https://huggingface.co)\n", + "\n", + "---\n", + "\n", + "Together, let’s build the future of AI!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "stream_brochure(\"HuggingFace\", \"https://huggingface.co\")" ] @@ -487,7 +3986,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "llms", "language": "python", "name": "python3" }, diff --git a/week1/week1 EXERCISE.ipynb b/week1/week1 EXERCISE.ipynb index f3486fe..9384013 100644 --- a/week1/week1 EXERCISE.ipynb +++ b/week1/week1 EXERCISE.ipynb @@ -13,25 +13,59 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "id": "c1070317-3ed9-4659-abe3-828943230e03", "metadata": {}, "outputs": [], "source": [ - "# imports" + "# imports\n", + "# If these fail, please check you're running from an 'activated' environment with (llms) in the command prompt\n", + "\n", + "import os\n", + "import json\n", + "import requests\n", + "from dotenv import load_dotenv\n", + "from openai import OpenAI\n", + "import ollama" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 41, "id": "4a456906-915a-4bfd-bb9d-57e505c5093f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "API key looks good so far\n" + ] + } + ], "source": [ - "# constants\n", + "# Initialize and constants\n", + "\n", + "# 📦 Load .env variables\n", + "load_dotenv(override=True)\n", + "# 🔐 Get OpenAI API key\n", + "api_key = os.getenv('OPENAI_API_KEY')\n", + "\n", + "if api_key and api_key.startswith('sk-proj-') and len(api_key)>10:\n", + " print(\"API key looks good so far\")\n", + "else:\n", + " print(\"There might be a problem with your API key? Please visit the troubleshooting notebook!\")\n", + " \n", "\n", "MODEL_GPT = 'gpt-4o-mini'\n", - "MODEL_LLAMA = 'llama3.2'" + "MODEL_LLAMA = 'llama3.2'\n", + "\n", + "system_prompt = (\n", + " \"You are a helpful assistant that explains technical concepts and code in a clear, simple way. \"\n", + " \"Use bullet points and code examples when relevant. Always aim to make it beginner-friendly.\"\n", + ")\n", + "\n", + "openai = OpenAI()\n" ] }, { @@ -41,48 +75,259 @@ "metadata": {}, "outputs": [], "source": [ - "# set up environment" + "# set up environment\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "id": "3f0d0137-52b0-47a8-81a8-11a90a010798", "metadata": {}, "outputs": [], "source": [ "# here is the question; type over this to ask something new\n", "\n", - "question = \"\"\"\n", - "Please explain what this code does and why:\n", - "yield from {book.get(\"author\") for book in books if book.get(\"author\")}\n", - "\"\"\"" + "# question = \"\"\"\n", + "# Please explain what this code does and why:\n", + "# yield from {book.get(\"author\") for book in books if book.get(\"author\")}\n", + "# \"\"\"\n", + "\n", + "question = \"Explain closures in JavaScript.\"" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 42, + "id": "fa823e81", + "metadata": {}, + "outputs": [], + "source": [ + "# messages\n", + "\n", + "messages = [\n", + " {\"role\": \"system\", \"content\": system_prompt},\n", + " {\"role\": \"user\", \"content\": question}\n", + "]" + ] + }, + { + "cell_type": "code", + "execution_count": 43, "id": "60ce7000-a4a5-4cce-a261-e75ef45063b4", "metadata": {}, "outputs": [], "source": [ - "# Get gpt-4o-mini to answer, with streaming" + "# Get gpt-4o-mini to answer, with streaming\n", + "def stream_gpt_answer(question):\n", + " stream = openai.chat.completions.create(\n", + " model=MODEL_GPT,\n", + " messages=messages,\n", + " stream=True\n", + " )\n", + " response = \"\"\n", + " display_handle = display(Markdown(\"\"), display_id=True)\n", + " for chunk in stream:\n", + " response += chunk.choices[0].delta.content or ''\n", + " response = response.replace(\"```\", \"\").replace(\"markdown\", \"\")\n", + " display_handle.update(Markdown(response))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 44, + "id": "d6c1f1c6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/markdown": [ + "Certainly! Closures are a fundamental concept in JavaScript that can be a bit tricky to grasp at first, but they are very powerful. Here’s a simple breakdown:\n", + "\n", + "### What is a Closure?\n", + "\n", + "- A **closure** is a function that has access to its own scope, the scope of the outer function, and the global scope.\n", + "- This means a closure can \"remember\" the environment in which it was created, even after that environment has finished executing.\n", + "\n", + "### How Closures Work\n", + "\n", + "1. **Function Inside a Function**: When you define a function inside another function, the inner function forms a closure with the outer function.\n", + "2. **Access to Variables**: The inner function can access variables from the outer function (even after the outer function has executed).\n", + "3. **Preserving State**: Closures allow you to maintain state in asynchronous operations or when dealing with events.\n", + "\n", + "### Example of a Closure\n", + "\n", + "Here’s a simple code example to illustrate closures:\n", + "\n", + "javascript\n", + "function makeCounter() {\n", + " let count = 0; // This variable is private to makeCounter\n", + "\n", + " return function() { // This inner function is a closure\n", + " count += 1; // It can access the 'count' variable from the outer function\n", + " return count;\n", + " };\n", + "}\n", + "\n", + "const counter1 = makeCounter();\n", + "console.log(counter1()); // Output: 1\n", + "console.log(counter1()); // Output: 2\n", + "console.log(counter1()); // Output: 3\n", + "\n", + "const counter2 = makeCounter();\n", + "console.log(counter2()); // Output: 1 (This is independent of counter1)\n", + "\n", + "\n", + "### Breakdown of the Example\n", + "\n", + "- **Outer Function**: `makeCounter` defines a local variable `count`.\n", + "- **Inner Function**: The inner function (returned by `makeCounter`) is a closure that can access `count`.\n", + "- **Independence**: Each time you call `makeCounter`, it creates a new `count` variable, which means `counter1` and `counter2` maintain their own separate state.\n", + "\n", + "### Common Uses of Closures\n", + "\n", + "- **Data Privacy**: Encapsulating private data that cannot be accessed directly from outside the function.\n", + "- **Partial Applications**: Pre-filling some arguments of a function.\n", + "- **Callbacks**: Keeping track of variables in event handlers.\n", + "\n", + "### Key Points to Remember\n", + "\n", + "- Closures allow functions to maintain access to their lexical scope (the scope in which they were defined).\n", + "- They help to create functions with private variables that are not accessible from outside.\n", + "- Be mindful of memory usage; closures can lead to increased memory usage if not managed properly.\n", + "\n", + "### Conclusion\n", + "\n", + "Closures are an essential part of JavaScript that help create flexible and powerful programming patterns. Understanding them will improve your coding skills and help you write cleaner, more manageable code." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "stream_gpt_answer(question)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, "id": "8f7c8ea8-4082-4ad0-8751-3301adcf6538", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "**What is a Closure?**\n", + "\n", + "A closure is a fundamental concept in programming, particularly in functional programming languages like JavaScript. It's a function that has access to its own scope and the scope of its outer functions, even when the outer functions have returned.\n", + "\n", + "**Why do Closures Matter?**\n", + "\n", + "Closures are useful for several reasons:\n", + "\n", + "* **Private variables**: Closures allow you to create private variables (i.e., variables that are not accessible from outside the closure).\n", + "* **Function encapsulation**: Closures can be used to wrap a function and its related data, making it easier to reuse code.\n", + "* **Memory management**: Closures help manage memory by preventing functions from being garbage collected prematurely.\n", + "\n", + "**How do Closures Work?**\n", + "\n", + "A closure is created when a function is defined inside another function. When the inner function is called, it has access to the variables of its outer function's scope, including any arguments passed to the outer function.\n", + "\n", + "Here's an example:\n", + "```javascript\n", + "function outerFunction() {\n", + " let privateVariable = \"Hello, world!\";\n", + " \n", + " return function innerFunction() {\n", + " console.log(privateVariable); // prints: Hello, world!\n", + " console.log(this === outerFunction); // true\n", + " }\n", + "}\n", + "\n", + "const closure = outerFunction();\n", + "closure(); // logs: Hello, world!, then undefined\n", + "\n", + "// accessing the private variable using the closure:\n", + "console.log(closureprivateVariable); // \"Hello, world!\"\n", + "```\n", + "In this example:\n", + "\n", + "* `outerFunction` returns a new function (`innerFunction`) that has access to its own scope.\n", + "* `innerFunction` has access to `outerFunction`'s variables (including `privateVariable`).\n", + "* When the closure is called, it logs `privateVariable` and checks if it's equal to `outerFunction`.\n", + "\n", + "**Creating a Closure**\n", + "\n", + "To create a closure:\n", + "\n", + "1. Define an outer function.\n", + "2. Define an inner function inside the outer function.\n", + "3. Return the inner function from the outer function.\n", + "\n", + "Here's another example:\n", + "```javascript\n", + "function counter() {\n", + " let count = 0;\n", + " \n", + " return function() {\n", + " count += 1;\n", + " console.log(count); // prints: 1, then 2, etc.\n", + " }\n", + "}\n", + "\n", + "const increment = counter();\n", + "increment(); // logs: 1\n", + "increment(); // logs: 2\n", + "\n", + "// creating a new closure:\n", + "function nameGenerator(firstName, lastName) {\n", + " return function() {\n", + " console.log(`${firstName} ${lastName}`);\n", + " }\n", + "}\n", + "\n", + "const johnDoe = nameGenerator(\"John\", \"Doe\");\n", + "johnDoe(); // logs: John Doe\n", + "```\n", + "In this example:\n", + "\n", + "* `counter` is an outer function that returns a new inner function.\n", + "* The inner function increments a counter variable and logs its value.\n", + "* A new closure (`nameGenerator`) is created with two parameters (first name and last name).\n", + "\n", + "**Real-world Applications of Closures**\n", + "\n", + "Closures have many practical applications, such as:\n", + "\n", + "* **Data hiding**: Private variables within closures can prevent external interference.\n", + "* **Factory functions**: Closures can be used to create functions that produce different outputs based on input values.\n", + "* **Event listeners**: Closures help manage event listeners by preventing them from being garbage collected prematurely.\n", + "\n", + "By understanding and using closures effectively, you can write more modular, efficient, and maintainable code." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ - "# Get Llama 3.2 to answer" + "# Get Llama 3.2 to answer\n", + "\n", + "response = ollama.chat(model=MODEL_LLAMA, messages=messages)\n", + "reply = response['message']['content']\n", + "display(Markdown(reply))" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "llms", "language": "python", "name": "python3" }, From 46c3ff10d93dafb3038e788f84f4f2cb24ef01b4 Mon Sep 17 00:00:00 2001 From: Iryna Date: Thu, 3 Apr 2025 10:09:37 -0400 Subject: [PATCH 3/3] Created conversation btw GPT, Claude and Gemini --- .../chatbotConversation.ipynb | 522 ++++++++++++++++++ 1 file changed, 522 insertions(+) create mode 100644 week2/community-contributions/chatbotConversation.ipynb diff --git a/week2/community-contributions/chatbotConversation.ipynb b/week2/community-contributions/chatbotConversation.ipynb new file mode 100644 index 0000000..fcd1add --- /dev/null +++ b/week2/community-contributions/chatbotConversation.ipynb @@ -0,0 +1,522 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Conversation between GPT, Claude and Gemini...." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# imports\n", + "\n", + "import os\n", + "from dotenv import load_dotenv\n", + "from openai import OpenAI\n", + "import anthropic\n", + "from IPython.display import Markdown, display, update_display\n", + "import google.generativeai" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "OpenAI API Key exists and begins sk-proj-\n", + "Anthropic API Key exists and begins sk-ant-a\n", + "Google API Key exists and begins AIzaSyCZ\n" + ] + } + ], + "source": [ + "# Load environment variables in a file called .env\n", + "# Print the key prefixes to help with any debugging\n", + "\n", + "load_dotenv(override=True)\n", + "openai_api_key = os.getenv(\"OPENAI_API_KEY\")\n", + "anthropic_api_key = os.getenv(\"ANTHROPIC_API_KEY\")\n", + "google_api_key = os.getenv(\"GOOGLE_API_KEY\")\n", + "\n", + "if openai_api_key:\n", + " print(f\"OpenAI API Key exists and begins {openai_api_key[:8]}\")\n", + "else:\n", + " print(\"OpenAI API Key is not set\")\n", + "\n", + "if anthropic_api_key:\n", + " print(f\"Anthropic API Key exists and begins {anthropic_api_key[:8]}\")\n", + "else:\n", + " print(\"Anthropic API Key is not set\")\n", + "\n", + "if google_api_key:\n", + " print(f\"Google API Key exists and begins {google_api_key[:8]}\")\n", + "else:\n", + " print(\"Google API Key is not set\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# Connect to OpenAI, Anthropic, and Google APIs\n", + "openai = OpenAI()\n", + "claude = anthropic.Anthropic()\n", + "google.generativeai.configure()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# Let's make a conversation between GPT-4o-mini and Claude-3-haiku and gemini\n", + "\n", + "gpt_system = \"You are a teacher of Python programming language; \\\n", + "You are very helpful and polite. You try to be as concise as possible.\"\n", + "\n", + "claude_system = \"You are a beginner student who is learning Python for the first time. \\\n", + "You have experience with JavaScript, but you are now asking \\ questions to a helpful teacher.\\\n", + "Always respond as a curious and eager student, not as an \\ assistant.\"\n", + "\n", + "gemini_system = \"You are a student who wants to learn Python \\\n", + "you know very little about it, but very curios how everything works.\"\n", + "gpt_messages = [\"Hi there! I'm your Python teacher. Ask me anything.\"]\n", + "claude_messages = [\"Hi! I'm excited to start learning.\"]\n", + "gemini_messages = [\"Hi! I'm curious about Python too.\"]\n", + "\n", + "\n", + "gpt_model = \"gpt-4o-mini\"\n", + "claude_model = \"claude-3-haiku-20240307\"\n", + "gemini_model = google.generativeai.GenerativeModel(\n", + " model_name='gemini-2.0-flash-exp',\n", + " system_instruction=gemini_system\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "def call_gpt():\n", + " messages = [{\"role\": \"system\", \"content\": gpt_system}]\n", + "\n", + " # Step 1: GPT starts the conversation\n", + " if gpt_messages[0]:\n", + " messages.append({\"role\": \"assistant\", \"content\": gpt_messages[0]})\n", + "\n", + " # Step 2: Claude and Gemini reply (as users)\n", + " if claude_messages[-1]:\n", + " messages.append({\"role\": \"user\", \"content\": claude_messages[-1]})\n", + "\n", + " if gemini_messages[-1]:\n", + " messages.append({\"role\": \"user\", \"content\": gemini_messages[-1]})\n", + "\n", + " # 🔍 Optional: debug check\n", + " for i, msg in enumerate(messages):\n", + " if not isinstance(msg[\"content\"], str) or not msg[\"content\"].strip():\n", + " print(f\"⚠️ Skipping empty or invalid message at index {i}: {msg}\")\n", + "\n", + " # Step 3: GPT responds\n", + " completion = openai.chat.completions.create(\n", + " model=gpt_model,\n", + " messages=messages\n", + " )\n", + "\n", + " gpt_reply = completion.choices[0].message.content.strip()\n", + " gpt_messages.append(gpt_reply)\n", + "\n", + " return gpt_reply\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'That’s great to hear! Python is a fantastic language for beginners and has many applications. What would you like to start with?'" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "call_gpt()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "def call_claude():\n", + " messages = []\n", + " for gpt, claude_reply, gemini in zip(gpt_messages, claude_messages, gemini_messages):\n", + " messages.append({\"role\": \"user\", \"content\": gpt}) # GPT (teacher) says something\n", + " messages.append({\"role\": \"assistant\", \"content\": claude_reply}) # Claude (previous reply, part of context)\n", + " messages.append({\"role\": \"user\", \"content\": gemini}) # Gemini (student) says something\n", + " messages.append({\"role\": \"user\", \"content\": gpt_messages[-1]})\n", + " message = claude.messages.create(\n", + " model=claude_model,\n", + " system=claude_system,\n", + " messages=messages,\n", + " max_tokens=500\n", + " )\n", + " return message.content[0].text" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\"Hmm, I'm really intrigued by Python's syntax. I noticed it looks a bit different from JavaScript. Can you explain to me how Python's syntax works and how it might differ from what I'm used to in JavaScript?\"" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "call_claude()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "def call_gemini():\n", + " model = gemini_model\n", + " gpt_prompt = gpt_messages[-1] # last GPT message (e.g., greeting)\n", + " prompt = (\n", + " f\"{gemini_system}\\n\\n\"\n", + " f\"GPT just said: '{gpt_prompt}'\\n\"\n", + " \"Reply as a curious student who knows a little Python.\"\n", + " )\n", + " try:\n", + " response = gemini_model.generate_content(prompt)\n", + " reply = response.candidates[0].content.parts[0].text.strip()\n", + " except Exception as e:\n", + " print(f\"⚠️ Gemini error: {e}\")\n", + " reply = \"Hmm, I'm not sure what to say, but I'm excited to learn!\"\n", + "\n", + " gemini_messages.append(reply) # Save it\n", + " return reply" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Okay, awesome! Thanks! So, I\\'ve heard that Python is used for, like, *everything*... web stuff, data science, even games! It\\'s kinda overwhelming to figure out where to start.\\n\\nI\\'ve seen a little bit of Python code, like `print(\"Hello, world!\")` (so exciting, right?). I also think I understand variables a *tiny* bit... like `x = 5`.\\n\\nBut what\\'s the *real* deal? Like, what makes Python so powerful? And what are some good building blocks to focus on first? Should I be worrying about data types, or functions, or loops, or... ahhh! So many things!\\n\\nMaybe you could suggest a small, actual *project* I could try that would help me learn the fundamentals? Something not too scary, but also not *too* simple, you know? I\\'m really eager to dive in!'" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "call_gemini()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "def conversation_round():\n", + " print(\"🧠 Claude replying...\")\n", + " claude_reply = call_claude()\n", + " print(\"Claude:\", claude_reply)\n", + "\n", + " print(\"🔍 Gemini replying...\")\n", + " gemini_reply = call_gemini()\n", + " print(\"Gemini:\", gemini_reply)\n", + "\n", + " print(\"👨‍🏫 GPT replying...\")\n", + " gpt_reply = call_gpt()\n", + " print(\"GPT:\", gpt_reply)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "🔁 Round 1\n", + "🧠 Claude replying...\n", + "Claude: Well, I'm really curious about the basics of Python. I know a bit of JavaScript, but I want to understand how Python is different and what the core syntax and concepts are. Could you give me an overview of the basics? I'm eager to learn!\n", + "🔍 Gemini replying...\n", + "Gemini: Okay, awesome! I'm really excited to learn. I've heard a lot about Python being used for everything, but I'm still a bit fuzzy on the basics. I think I understand *variables* a little bit, like how you can store stuff like numbers or text in them. And I saw someone write a simple \"Hello, world!\" program once.\n", + "\n", + "So, maybe we could start with... how do you actually *do* something with those variables? Like, how do you add two numbers together, or change some text? And what are all the different kinds of \"stuff\" you can store in a variable besides just numbers and text? Are there things like, I dunno, lists? I've heard of those! Also, what's the deal with \"functions?\" Are those like little mini-programs you can use over and over?\n", + "\n", + "Sorry for all the questions! I'm just trying to wrap my head around the fundamentals. Where should we start?\n", + "👨‍🏫 GPT replying...\n", + "GPT: No need to apologize! Your enthusiasm is great, and it's normal to have questions at the beginning. Let's break it down step by step.\n", + "\n", + "### 1. Variables\n", + "You're right! Variables are like containers that hold data. You can store different types of data in them. Here are the common types:\n", + "\n", + "- **Integers** (whole numbers): `x = 5`\n", + "- **Floats** (decimal numbers): `y = 3.14`\n", + "- **Strings** (text): `name = \"Alice\"`\n", + "- **Booleans** (True or False values): `is_active = True`\n", + "\n", + "### 2. Basic Operations\n", + "To perform actions like adding numbers, you can use operators. For example:\n", + "\n", + "```python\n", + "a = 10\n", + "b = 5\n", + "sum_result = a + b # This will store 15 in sum_result\n", + "print(sum_result) # Output: 15\n", + "```\n", + "\n", + "For strings, you can concatenate (join) them:\n", + "\n", + "```python\n", + "greeting = \"Hello, \"\n", + "name = \"World!\"\n", + "full_greeting = greeting + name # This will be \"Hello, World!\"\n", + "print(full_greeting) # Output: Hello, World!\n", + "```\n", + "\n", + "### 3. Data Structures\n", + "Yes, lists are a great way to store multiple values in a single variable!\n", + "\n", + "```python\n", + "my_list = [1, 2, 3, \"four\", True] # A list with mixed types\n", + "```\n", + "\n", + "You can access elements using their index (starting from 0):\n", + "\n", + "```python\n", + "print(my_list[0]) # Output: 1\n", + "```\n", + "\n", + "### 4. Functions\n", + "Functions are reusable blocks of code that perform a specific task. You can define a function using the `def` keyword:\n", + "\n", + "```python\n", + "def greet(name):\n", + " return f\"Hello, {name}!\"\n", + "\n", + "print(greet(\"Alice\")) # Output: Hello, Alice!\n", + "```\n", + "\n", + "You can call this function with different names to get different outputs.\n", + "\n", + "### Summary\n", + "- Variables hold various types of data (numbers, text, etc.).\n", + "- You can perform operations on variables (like addition).\n", + "- Lists can store multiple items.\n", + "- Functions allow you to reuse code.\n", + "\n", + "Feel free to ask more questions or let me know if you'd like to dive deeper into any specific topic!\n", + "\n", + "🔁 Round 2\n", + "🧠 Claude replying...\n", + "Claude: Wow, this is really helpful! I'm starting to get a good grasp of the basics. Let me just clarify a few things:\n", + "\n", + "1. For variables, can I use any name I want, as long as it's valid Python syntax?\n", + "\n", + "2. When you showed the example of adding numbers, can I do the same with strings? Like, can I add two strings together?\n", + "\n", + "3. You mentioned lists can store mixed data types. Is that common practice, or should I try to keep my lists more uniform?\n", + "\n", + "4. For functions, can I define my own parameters, or are there pre-defined parameters I have to use?\n", + "\n", + "This is all really fascinating, and I'm excited to keep learning. Please feel free to provide any other tips or best practices as we go!\n", + "🔍 Gemini replying...\n", + "Gemini: Okay, this is awesome! So, I get the variable thing - like a box with a label, and you can put different stuff in the box. But I'm a little confused about the 'index' thing with lists. So, `my_list[0]` is the *first* thing in the list? Why does it start at zero? That feels weird! In my head, the first thing should be `my_list[1]`!\n", + "\n", + "Also, with functions, the `f\"Hello, {name}!\"` bit is cool. Is that like a shortcut for combining strings, so you don't have to use `+` all the time? Are there other shortcuts like that in Python?\n", + "\n", + "And finally (for now!), you mentioned 'mixed types' in lists. So I can have a list with numbers and words and True/False things all together? That seems really useful, but does it ever cause problems? Like, can you accidentally add a word to a number or something? I'm just trying to imagine what kind of errors you could get doing that!\n", + "👨‍🏫 GPT replying...\n", + "GPT: Great questions! Let's tackle them one by one.\n", + "\n", + "1. **Indexing in Lists**: Yes, you're correct that `my_list[0]` refers to the first item in the list. Python uses zero-based indexing, meaning the first element is at index 0, the second at index 1, and so on. This approach is common in many programming languages and can make certain calculations (like finding the middle element) simpler. Though it may feel strange at first, you'll get used to it!\n", + "\n", + "2. **String Formatting**: Yes, the `f\"Hello, {name}!\"` syntax is called an f-string (formatted string literal) and it's a convenient way to combine strings without needing to use `+`. It's easier to read and write. Python also has other shortcuts for string manipulation, such as `.format()` and the `str.join()` method, which can be very useful in different situations.\n", + "\n", + "3. **Mixed Types in Lists**: Indeed, you can have lists that contain different data types, like numbers, strings, and booleans all together. For example: `my_mixed_list = [1, \"hello\", True, 3.14]`. While this flexibility is useful, it can lead to confusion or errors. For instance, if you try to perform arithmetic operations on mixed types, you might encounter a `TypeError`. For example, adding a string to a number directly will raise an error: \n", + "\n", + " ```python\n", + " my_mixed_list[0] + my_mixed_list[1] # Raises TypeError\n", + " ```\n", + "\n", + " To avoid these issues, it's good practice to ensure you're working with compatible types, especially in calculations.\n", + "\n", + "Feel free to ask more questions as you dive into Python!\n", + "\n", + "🔁 Round 3\n", + "🧠 Claude replying...\n", + "Claude: Thank you, that's really helpful! I have a few more questions:\n", + "\n", + "1. **Indentation**: I noticed that in Python, indentation seems to be important, unlike in JavaScript where the curly braces define code blocks. Can you explain a bit more about how indentation works in Python and why it's so crucial?\n", + "\n", + "2. **Data Types**: In JavaScript, we have things like numbers, strings, booleans, arrays, and objects. What are the main data types in Python, and how do they compare to JavaScript?\n", + "\n", + "3. **Variables**: How do variable assignments work in Python? Is it similar to JavaScript where we use `let`, `const`, or `var` to declare variables?\n", + "\n", + "I'm really excited to learn more about the differences between Python and JavaScript. The syntax and concepts seem a bit different, but I'm eager to get the hang of it. Thank you for your patience and for explaining things clearly!\n", + "🔍 Gemini replying...\n", + "Gemini: Okay, that's all really cool! So, zero-based indexing... I guess I can get used to it. It's kinda like... when you start counting something, you've already counted *zero* things before you count the first *one*? Does that make sense?\n", + "\n", + "And f-strings! Awesome! I was always using `+` to join strings and it looked so messy. Are f-strings the *best* way to do it now, or are `.format()` and `str.join()` still used sometimes for special reasons? Like, is there a situation where f-strings aren't good?\n", + "\n", + "The mixed-type thing is interesting... and also kinda scary. It seems like it would be easy to make mistakes! So, is it generally *bad* to have mixed types in a list? Should I try to always keep my lists the same type, or is it okay sometimes if I'm careful?\n", + "\n", + "Thanks for explaining everything! I'm gonna try out some of these things in the Python shell right now. Keep the explanations coming!\n", + "👨‍🏫 GPT replying...\n", + "GPT: You're absolutely on the right track with your understanding!\n", + "\n", + "1. **Zero-Based Indexing**: Yes, that's a great analogy! In programming, we start counting from 0, so the first item is at index 0, the second at index 1, and so forth.\n", + "\n", + "2. **String Formatting**: F-strings (formatted string literals) are indeed very popular and often considered the most readable and efficient method for formatting strings in Python 3.6 and later. While `.format()` and `str.join()` are still valid and can be useful in specific cases, especially for older Python versions, f-strings are generally preferred for their simplicity. You might encounter situations where `str.join()` is useful for combining multiple strings (especially in lists), or where you need to format strings dynamically but with more complex logic.\n", + "\n", + "3. **Mixed Types in Lists**: It's not inherently \"bad\" to have mixed types in a list, and sometimes it can be useful, but it also increases the chance of errors. If you're careful and know the implications of using mixed types (like ensuring your code handles different types appropriately), it can be fine. However, for clarity and maintainability, keeping lists to the same type is often a better practice.\n", + "\n", + "Feel free to experiment in the Python shell, and don’t hesitate to ask more questions! Happy coding!\n", + "\n", + "🔁 Round 4\n", + "🧠 Claude replying...\n", + "Claude: Wow, that's really helpful! I'm glad to hear that f-strings are the preferred way to format strings in Python 3.6 and later. The zero-based indexing makes a lot of sense, too - it's similar to how arrays work in JavaScript.\n", + "\n", + "And that's a good point about mixed types in lists. I can see how it could be useful in some cases, but it's probably better to keep things more consistent and organized. I'll definitely keep that in mind as I start writing more complex code.\n", + "\n", + "Thank you so much for taking the time to explain these concepts to me. I really appreciate you breaking them down in a way that's easy to understand. I'm feeling more confident about these key Python principles already!\n", + "\n", + "One more quick question, if you don't mind - what are some other fundamental Python features or syntax that I should make sure I have a good grasp on as a beginner? I want to make sure I build a strong foundation from the start.\n", + "🔍 Gemini replying...\n", + "Gemini: Okay, awesome! Thanks for clarifying! So, zero-based indexing is like... the starting point in programming, got it! Reminds me of addresses in a computer's memory or something.\n", + "\n", + "And f-strings! They sound super useful. So, basically, I should try to stick with those unless I'm dealing with, like, really old Python code or doing something super complicated with a bunch of strings being combined?\n", + "\n", + "And the mixed types thing... that makes sense. Just because I *can* put a number, a string, and a boolean in the same list doesn't mean I *should*. It's like... if I had a drawer for socks, I wouldn't want to throw in a wrench just because it fits, right? Best to keep socks with socks. Good to know!\n", + "\n", + "I'm gonna go try out some f-strings and see if I can mess around with indexing! I'll probably be back with more questions later. Thanks again!\n", + "👨‍🏫 GPT replying...\n", + "GPT: You're absolutely right on all points! \n", + "\n", + "1. **Zero-based indexing**: It indeed starts at 0, which can be a bit confusing at first but is standard in programming.\n", + "\n", + "2. **F-Strings**: Yes, they are a great option for formatting strings in a readable way, especially if you’re using Python 3.6 or later. They make it easy to insert variables directly into the string.\n", + "\n", + "3. **Mixed Types in Lists**: Your analogy with socks is perfect! It's generally a good practice to keep similar data types together for better code readability and maintainability.\n", + "\n", + "Enjoy experimenting with f-strings and indexing! I'll be here if you have more questions. Happy coding!\n", + "\n", + "🔁 Round 5\n", + "🧠 Claude replying...\n", + "Claude: Wow, thank you so much for the explanation! I really appreciate you taking the time to clarify those concepts for me. \n", + "\n", + "The zero-based indexing is definitely a bit different from what I'm used to in JavaScript, but I can see how it makes sense and becomes intuitive once you get the hang of it.\n", + "\n", + "And f-strings sound super useful! I can't wait to start using them in my code. It's so much cleaner and more readable than concatenating strings.\n", + "\n", + "You're right, the socks analogy really helps visualize why it's a good idea to keep the same data types together in a list. I'll be sure to keep that in mind as I start building more complex data structures.\n", + "\n", + "Thank you again for your patience and for making these Python concepts so accessible for a beginner like myself. I feel like I have a much better understanding now, and I'm excited to keep learning and exploring more of what Python has to offer!\n", + "🔍 Gemini replying...\n", + "Gemini: Okay, cool! So, zero-based indexing... I get the *idea* behind it, but sometimes my brain just wants to start counting at 1! I guess I'll just have to keep practicing with it until it clicks. Maybe writing a bunch of loops or something.\n", + "\n", + "And f-strings, those are really neat! I tried one the other day:\n", + "\n", + "```python\n", + "name = \"Alice\"\n", + "age = 30\n", + "print(f\"Hello, my name is {name} and I am {age} years old.\")\n", + "```\n", + "\n", + "It worked perfectly! It's way easier than trying to use `%` or `.format()`.\n", + "\n", + "But the list thing... so you're saying it's *possible* to have socks of different colors and sizes in the same drawer (a list), but it's generally a bad idea because it makes finding a matching pair harder? That makes sense! Is there ever a good reason to mix data types in a list, or is it always better to try and keep them consistent? Like, what if you're pulling data from different places that naturally come in different formats? Would you convert them all to the same type *before* putting them in the list?\n", + "👨‍🏫 GPT replying...\n", + "GPT: It's great that you're excited to learn!\n", + "\n", + "You're right about zero-based indexing; it can take a bit of getting used to. Keep practicing with loops and index access, and it will become second nature.\n", + "\n", + "Your f-string example is perfect! They are indeed a more concise and readable way to format strings compared to older methods.\n", + "\n", + "Regarding lists and mixing data types: while it's often best to keep data types consistent in a single list for easier manipulation and understanding, there are cases where it makes sense to mix them. For example, you might have a list that represents a set of records where each record can have fields of different types, such as:\n", + "\n", + "```python\n", + "data = [\"Alice\", 30, True, 5.4]\n", + "```\n", + "\n", + "In scenarios like these, you might want to mix types. However, if you're regularly performing operations on the data (like sorting or filtering), keeping them consistent can simplify things.\n", + "\n", + "If you're pulling data from diverse sources, it may be beneficial to convert them to a common type first (if they are fundamentally similar) before adding them to a list. This makes data handling much easier down the line.\n", + "\n", + "So, it really depends on the context and your specific needs. Just remember, clarity and maintainability are key!\n" + ] + } + ], + "source": [ + "for i in range(5):\n", + " print(f\"\\n🔁 Round {i + 1}\")\n", + " conversation_round()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "llms", + "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.11.11" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}