You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

3930 lines
139 KiB

{
"cells": [
{
"cell_type": "markdown",
"id": "a98030af-fcd1-4d63-a36e-38ba053498fa",
"metadata": {},
"source": [
"# A full business solution\n",
"\n",
"## Now we will take our project from Day 1 to the next level\n",
"\n",
"### BUSINESS CHALLENGE:\n",
"\n",
"Create a product that builds a Brochure for a company to be used for prospective clients, investors and potential recruits.\n",
"\n",
"We will be provided a company name and their primary website.\n",
"\n",
"See the end of this notebook for examples of real-world business applications.\n",
"\n",
"And remember: I'm always available if you have problems or ideas! Please do reach out."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "d5b08506-dc8b-4443-9201-5f1848161363",
"metadata": {},
"outputs": [],
"source": [
"# 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 requests\n",
"import json\n",
"from typing import List\n",
"from dotenv import load_dotenv\n",
"from bs4 import BeautifulSoup\n",
"from IPython.display import Markdown, display, update_display\n",
"from openai import OpenAI"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "fc5d8880-f2ee-4c06-af16-ecbc0262af61",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"API key looks good so far\n"
]
}
],
"source": [
"# Initialize and constants\n",
"\n",
"load_dotenv(override=True)\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",
"MODEL = 'gpt-4o-mini'\n",
"openai = OpenAI()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "106dd65e-90af-4ca8-86b6-23a41840645b",
"metadata": {},
"outputs": [],
"source": [
"# A class to represent a Webpage\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",
" A utility class to represent a Website that we have scraped, now with links\n",
" \"\"\"\n",
"\n",
" def __init__(self, url):\n",
" self.url = url\n",
" response = requests.get(url, headers=headers)\n",
" self.body = response.content\n",
" soup = BeautifulSoup(self.body, 'html.parser')\n",
" self.title = soup.title.string if soup.title else \"No title found\"\n",
" if soup.body:\n",
" for irrelevant in soup.body([\"script\", \"style\", \"img\", \"input\"]):\n",
" irrelevant.decompose()\n",
" self.text = soup.body.get_text(separator=\"\\n\", strip=True)\n",
" else:\n",
" self.text = \"\"\n",
" links = [link.get('href') for link in soup.find_all('a')]\n",
" self.links = [link for link in links if link]\n",
"\n",
" def get_contents(self):\n",
" return f\"Webpage Title:\\n{self.title}\\nWebpage Contents:\\n{self.text}\\n\\n\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "e30d8128-933b-44cc-81c8-ab4c9d86589a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['#content',\n",
" 'https://saviano.com/',\n",
" 'https://saviano.com/',\n",
" 'https://saviano.com/services/',\n",
" 'https://saviano.com/paving/',\n",
" 'https://saviano.com/grading/',\n",
" 'https://saviano.com/excavation/',\n",
" 'https://saviano.com/resurfacing/',\n",
" 'https://saviano.com/lighting/',\n",
" 'https://saviano.com/drainage/',\n",
" 'https://saviano.com/fencing/',\n",
" 'https://saviano.com/home/consulting/',\n",
" 'https://saviano.com/athletic-surfaces/',\n",
" 'https://saviano.com/pickleball-courts/',\n",
" 'https://saviano.com/tennis-court-construction/',\n",
" 'https://saviano.com/basketball-court-construction/',\n",
" 'https://saviano.com/running-tracks/',\n",
" 'https://saviano.com/cushion-services/',\n",
" 'https://saviano.com/about/',\n",
" 'https://saviano.com/blog/',\n",
" 'https://saviano.com/reviews/',\n",
" 'https://saviano.com/submit-a-review/',\n",
" 'https://saviano.com/olympics/',\n",
" 'https://saviano.com/tennis-booklet/',\n",
" 'https://saviano.com/global/',\n",
" 'https://saviano.com/request-a-quote/',\n",
" 'https://saviano.com/contact/',\n",
" 'https://saviano.com/services/',\n",
" 'https://saviano.com/courts/',\n",
" 'https://saviano.com/request-a-quote/']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#ed = Website(\"https://edwarddonner.com\")\n",
"ed = Website(\"https://saviano.com\")\n",
"ed.links"
]
},
{
"cell_type": "markdown",
"id": "1771af9c-717a-4fca-bbbe-8a95893312c3",
"metadata": {},
"source": [
"## First step: Have GPT-4o-mini figure out which links are relevant\n",
"\n",
"### Use a call to gpt-4o-mini to read the links on a webpage, and respond in structured JSON. \n",
"It should decide which links are relevant, and replace relative links such as \"/about\" with \"https://company.com/about\". \n",
"We will use \"one shot prompting\" in which we provide an example of how it should respond in the prompt.\n",
"\n",
"This is an excellent use case for an LLM, because it requires nuanced understanding. Imagine trying to code this without LLMs by parsing and analyzing the webpage - it would be very hard!\n",
"\n",
"Sidenote: there is a more advanced technique called \"Structured Outputs\" in which we require the model to respond according to a spec. We cover this technique in Week 8 during our autonomous Agentic AI project."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "6957b079-0d96-45f7-a26a-3487510e9b35",
"metadata": {},
"outputs": [],
"source": [
"link_system_prompt = \"You are provided with a list of links found on a webpage. \\\n",
"You are able to decide which of the links would be most relevant to include in a brochure about the company, \\\n",
"such as links to an About page, or a Company page, or Careers/Jobs pages.\\n\"\n",
"link_system_prompt += \"You should respond in JSON as in this example:\"\n",
"link_system_prompt += \"\"\"\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",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "b97e4068-97ed-4120-beae-c42105e4d59a",
"metadata": {},
"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": 8,
"id": "8e1f601b-2eaf-499d-b6b8-c99050c9d6b3",
"metadata": {},
"outputs": [],
"source": [
"def get_links_user_prompt(website):\n",
" user_prompt = f\"Here is the list of links on the website of {website.url} - \"\n",
" user_prompt += \"please decide which of these are relevant web links for a brochure about the company, respond with the full https URL in JSON format. \\\n",
"Do not include Terms of Service, Privacy, email links.\\n\"\n",
" user_prompt += \"Links (some might be relative links):\\n\"\n",
" user_prompt += \"\\n\".join(website.links)\n",
" return user_prompt"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "6bcbfa78-6395-4685-b92c-22d592050fd7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Here is the list of links on the website of https://saviano.com - 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",
"#content\n",
"https://saviano.com/\n",
"https://saviano.com/\n",
"https://saviano.com/services/\n",
"https://saviano.com/paving/\n",
"https://saviano.com/grading/\n",
"https://saviano.com/excavation/\n",
"https://saviano.com/resurfacing/\n",
"https://saviano.com/lighting/\n",
"https://saviano.com/drainage/\n",
"https://saviano.com/fencing/\n",
"https://saviano.com/home/consulting/\n",
"https://saviano.com/athletic-surfaces/\n",
"https://saviano.com/pickleball-courts/\n",
"https://saviano.com/tennis-court-construction/\n",
"https://saviano.com/basketball-court-construction/\n",
"https://saviano.com/running-tracks/\n",
"https://saviano.com/cushion-services/\n",
"https://saviano.com/about/\n",
"https://saviano.com/blog/\n",
"https://saviano.com/reviews/\n",
"https://saviano.com/submit-a-review/\n",
"https://saviano.com/olympics/\n",
"https://saviano.com/tennis-booklet/\n",
"https://saviano.com/global/\n",
"https://saviano.com/request-a-quote/\n",
"https://saviano.com/contact/\n",
"https://saviano.com/services/\n",
"https://saviano.com/courts/\n",
"https://saviano.com/request-a-quote/\n"
]
}
],
"source": [
"print(get_links_user_prompt(ed))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "a29aca19-ca13-471c-a4b4-5abbfa813f69",
"metadata": {},
"outputs": [],
"source": [
"def get_links(url):\n",
" website = Website(url)\n",
" response = openai.chat.completions.create(\n",
" model=MODEL,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": link_system_prompt},\n",
" {\"role\": \"user\", \"content\": get_links_user_prompt(website)}\n",
" ],\n",
" response_format={\"type\": \"json_object\"}\n",
" )\n",
" result = response.choices[0].message.content\n",
" return json.loads(result)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "74a827a0-2782-4ae5-b210-4a242a8b4cc2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['/',\n",
" '/models',\n",
" '/datasets',\n",
" '/spaces',\n",
" '/posts',\n",
" '/docs',\n",
" '/enterprise',\n",
" '/pricing',\n",
" '/login',\n",
" '/join',\n",
" '/blog/inference-providers',\n",
" '/deepseek-ai/DeepSeek-R1',\n",
" '/deepseek-ai/Janus-Pro-7B',\n",
" '/deepseek-ai/DeepSeek-V3',\n",
" '/mistralai/Mistral-Small-24B-Instruct-2501',\n",
" '/unsloth/DeepSeek-R1-GGUF',\n",
" '/models',\n",
" '/spaces/deepseek-ai/Janus-Pro-7B',\n",
" '/spaces/tencent/Hunyuan3D-2',\n",
" '/spaces/lllyasviel/iclight-v2',\n",
" '/spaces/Qwen/Qwen2.5-Max-Demo',\n",
" '/spaces/Mistral-AI-Game-Jam/NeuralJam',\n",
" '/spaces',\n",
" '/datasets/open-thoughts/OpenThoughts-114k',\n",
" '/datasets/fka/awesome-chatgpt-prompts',\n",
" '/datasets/cognitivecomputations/dolphin-r1',\n",
" '/datasets/ServiceNow-AI/R1-Distill-SFT',\n",
" '/datasets/bespokelabs/Bespoke-Stratos-17k',\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/peft',\n",
" '/docs/transformers.js',\n",
" '/docs/timm',\n",
" '/docs/trl',\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": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Anthropic has made their site harder to scrape, so I'm using HuggingFace..\n",
"\n",
"huggingface = Website(\"https://huggingface.co\")\n",
"huggingface.links"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "d3d583e2-dcc4-40cc-9b28-1e8dbf402924",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'links': [{'type': 'about page', 'url': 'https://huggingface.co'},\n",
" {'type': 'enterprise page', 'url': 'https://huggingface.co/enterprise'},\n",
" {'type': 'pricing page', 'url': 'https://huggingface.co/pricing'},\n",
" {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'},\n",
" {'type': 'blog page', 'url': 'https://huggingface.co/blog'},\n",
" {'type': 'discussion page', 'url': 'https://discuss.huggingface.co'},\n",
" {'type': 'GitHub page', 'url': 'https://github.com/huggingface'},\n",
" {'type': 'LinkedIn page',\n",
" 'url': 'https://www.linkedin.com/company/huggingface/'},\n",
" {'type': 'Twitter page', 'url': 'https://twitter.com/huggingface'}]}"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"get_links(\"https://huggingface.co\")"
]
},
{
"cell_type": "markdown",
"id": "0d74128e-dfb6-47ec-9549-288b621c838c",
"metadata": {},
"source": [
"## Second step: make the brochure!\n",
"\n",
"Assemble all the details into another prompt to GPT4-o"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "85a5b6e2-e7ef-44a9-bc7f-59ede71037b5",
"metadata": {},
"outputs": [],
"source": [
"def get_all_details(url):\n",
" result = \"Landing page:\\n\"\n",
" result += Website(url).get_contents()\n",
" links = get_links(url)\n",
" print(\"Found links:\", links)\n",
" for link in links[\"links\"]:\n",
" result += f\"\\n\\n{link['type']}\\n\"\n",
" result += Website(link[\"url\"]).get_contents()\n",
" return result"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "5099bd14-076d-4745-baf3-dac08d8e5ab2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found links: {'links': [{'type': 'about page', 'url': 'https://huggingface.co/'}, {'type': 'careers page', 'url': 'https://apply.workable.com/huggingface/'}, {'type': 'enterprise page', 'url': 'https://huggingface.co/enterprise'}, {'type': 'blog page', 'url': 'https://huggingface.co/blog'}, {'type': 'community page', 'url': 'https://discuss.huggingface.co'}, {'type': 'Github page', 'url': 'https://github.com/huggingface'}, {'type': 'LinkedIn page', 'url': 'https://www.linkedin.com/company/huggingface/'}, {'type': 'Twitter page', 'url': 'https://twitter.com/huggingface'}]}\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",
"NEW\n",
"Welcome to Inference Providers on the Hub 🔥\n",
"smolagents - a smol library to build great agents\n",
"Use models from the HF Hub in LM Studio\n",
"The AI community building the future.\n",
"The platform where the machine learning community collaborates on models, datasets, and applications.\n",
"Trending on\n",
"this week\n",
"Models\n",
"deepseek-ai/DeepSeek-R1\n",
"Updated\n",
"2 days ago\n",
"•\n",
"845k\n",
"•\n",
"6.06k\n",
"deepseek-ai/Janus-Pro-7B\n",
"Updated\n",
"1 day ago\n",
"•\n",
"134k\n",
"•\n",
"2.4k\n",
"deepseek-ai/DeepSeek-V3\n",
"Updated\n",
"10 days ago\n",
"•\n",
"877k\n",
"•\n",
"3.02k\n",
"mistralai/Mistral-Small-24B-Instruct-2501\n",
"Updated\n",
"about 12 hours ago\n",
"•\n",
"12.1k\n",
"•\n",
"492\n",
"unsloth/DeepSeek-R1-GGUF\n",
"Updated\n",
"3 days ago\n",
"•\n",
"262k\n",
"•\n",
"473\n",
"Browse 400k+ models\n",
"Spaces\n",
"Running\n",
"on\n",
"Zero\n",
"1.24k\n",
"🌍\n",
"Chat With Janus-Pro-7B\n",
"A unified multimodal understanding and generation model.\n",
"Running\n",
"on\n",
"Zero\n",
"1.16k\n",
"🌍\n",
"Hunyuan3D-2.0\n",
"Text-to-3D and Image-to-3D Generation\n",
"Running\n",
"on\n",
"Zero\n",
"2.37k\n",
"📈\n",
"IC Light V2\n",
"Running\n",
"330\n",
"🐢\n",
"Qwen2.5 Max Demo\n",
"Running\n",
"274\n",
"🚂\n",
"NeuralJam\n",
"EscapeExpress : LLM AI detective puzzle game.\n",
"Browse 150k+ applications\n",
"Datasets\n",
"open-thoughts/OpenThoughts-114k\n",
"Updated\n",
"5 days ago\n",
"•\n",
"11.4k\n",
"•\n",
"195\n",
"fka/awesome-chatgpt-prompts\n",
"Updated\n",
"28 days ago\n",
"•\n",
"8.91k\n",
"•\n",
"7.28k\n",
"cognitivecomputations/dolphin-r1\n",
"Updated\n",
"3 days ago\n",
"•\n",
"436\n",
"•\n",
"142\n",
"ServiceNow-AI/R1-Distill-SFT\n",
"Updated\n",
"5 days ago\n",
"•\n",
"1.16k\n",
"•\n",
"121\n",
"bespokelabs/Bespoke-Stratos-17k\n",
"Updated\n",
"3 days ago\n",
"•\n",
"21.3k\n",
"•\n",
"178\n",
"Browse 100k+ 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",
"381 models\n",
"•\n",
"2.08k followers\n",
"AI at Meta\n",
"Enterprise\n",
"company\n",
"•\n",
"2.06k models\n",
"•\n",
"4.36k followers\n",
"Amazon Web Services\n",
"company\n",
"•\n",
"20 models\n",
"•\n",
"2.64k followers\n",
"Google\n",
"company\n",
"•\n",
"913 models\n",
"•\n",
"7.14k followers\n",
"Intel\n",
"company\n",
"•\n",
"218 models\n",
"•\n",
"2.2k followers\n",
"Microsoft\n",
"company\n",
"•\n",
"354 models\n",
"•\n",
"7.99k followers\n",
"Grammarly\n",
"company\n",
"•\n",
"10 models\n",
"•\n",
"120 followers\n",
"Writer\n",
"Enterprise\n",
"company\n",
"•\n",
"19 models\n",
"•\n",
"203 followers\n",
"Our Open Source\n",
"We are building the foundation of ML tooling with the community.\n",
"Transformers\n",
"138,457\n",
"State-of-the-art ML for Pytorch, TensorFlow, and JAX.\n",
"Diffusers\n",
"27,351\n",
"State-of-the-art diffusion models for image and audio generation in PyTorch.\n",
"Safetensors\n",
"3,049\n",
"Simple, safe way to store and distribute neural networks weights safely and quickly.\n",
"Hub Python Library\n",
"2,288\n",
"Client library for the HF Hub: manage repositories from your Python runtime.\n",
"Tokenizers\n",
"9,320\n",
"Fast tokenizers, optimized for both research and production.\n",
"PEFT\n",
"17,127\n",
"Parameter efficient finetuning methods for large models.\n",
"Transformers.js\n",
"12,786\n",
"State-of-the-art Machine Learning for the web. Run Transformers directly in your browser, with no need for a server.\n",
"timm\n",
"33,042\n",
"State-of-the-art computer vision models, layers, optimizers, training/evaluation, and utilities.\n",
"TRL\n",
"10,982\n",
"Train transformer language models with reinforcement learning.\n",
"Datasets\n",
"19,535\n",
"Access and share datasets for computer vision, audio, and NLP tasks.\n",
"Text Generation Inference\n",
"9,685\n",
"Toolkit to serve Large Language Models.\n",
"Accelerate\n",
"8,253\n",
"Easily train and use 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",
"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",
"NEW\n",
"Welcome to Inference Providers on the Hub 🔥\n",
"smolagents - a smol library to build great agents\n",
"Use models from the HF Hub in LM Studio\n",
"The AI community building the future.\n",
"The platform where the machine learning community collaborates on models, datasets, and applications.\n",
"Trending on\n",
"this week\n",
"Models\n",
"deepseek-ai/DeepSeek-R1\n",
"Updated\n",
"2 days ago\n",
"•\n",
"845k\n",
"•\n",
"6.06k\n",
"deepseek-ai/Janus-Pro-7B\n",
"Updated\n",
"1 day ago\n",
"•\n",
"134k\n",
"•\n",
"2.4k\n",
"deepseek-ai/DeepSeek-V3\n",
"Updated\n",
"10 days ago\n",
"•\n",
"877k\n",
"•\n",
"3.02k\n",
"mistralai/Mistral-Small-24B-Instruct-2501\n",
"Updated\n",
"about 12 hours ago\n",
"•\n",
"12.1k\n",
"•\n",
"492\n",
"unsloth/DeepSeek-R1-GGUF\n",
"Updated\n",
"3 days ago\n",
"•\n",
"262k\n",
"•\n",
"473\n",
"Browse 400k+ models\n",
"Spaces\n",
"Running\n",
"on\n",
"Zero\n",
"1.24k\n",
"🌍\n",
"Chat With Janus-Pro-7B\n",
"A unified multimodal understanding and generation model.\n",
"Running\n",
"on\n",
"Zero\n",
"1.16k\n",
"🌍\n",
"Hunyuan3D-2.0\n",
"Text-to-3D and Image-to-3D Generation\n",
"Running\n",
"on\n",
"Zero\n",
"2.37k\n",
"📈\n",
"IC Light V2\n",
"Running\n",
"330\n",
"🐢\n",
"Qwen2.5 Max Demo\n",
"Running\n",
"274\n",
"🚂\n",
"NeuralJam\n",
"EscapeExpress : LLM AI detective puzzle game.\n",
"Browse 150k+ applications\n",
"Datasets\n",
"open-thoughts/OpenThoughts-114k\n",
"Updated\n",
"5 days ago\n",
"•\n",
"11.4k\n",
"•\n",
"195\n",
"fka/awesome-chatgpt-prompts\n",
"Updated\n",
"28 days ago\n",
"•\n",
"8.91k\n",
"•\n",
"7.28k\n",
"cognitivecomputations/dolphin-r1\n",
"Updated\n",
"3 days ago\n",
"•\n",
"436\n",
"•\n",
"142\n",
"ServiceNow-AI/R1-Distill-SFT\n",
"Updated\n",
"5 days ago\n",
"•\n",
"1.16k\n",
"•\n",
"121\n",
"bespokelabs/Bespoke-Stratos-17k\n",
"Updated\n",
"3 days ago\n",
"•\n",
"21.3k\n",
"•\n",
"178\n",
"Browse 100k+ 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",
"381 models\n",
"•\n",
"2.08k followers\n",
"AI at Meta\n",
"Enterprise\n",
"company\n",
"•\n",
"2.06k models\n",
"•\n",
"4.36k followers\n",
"Amazon Web Services\n",
"company\n",
"•\n",
"20 models\n",
"•\n",
"2.64k followers\n",
"Google\n",
"company\n",
"•\n",
"913 models\n",
"•\n",
"7.14k followers\n",
"Intel\n",
"company\n",
"•\n",
"218 models\n",
"•\n",
"2.2k followers\n",
"Microsoft\n",
"company\n",
"•\n",
"354 models\n",
"•\n",
"7.99k followers\n",
"Grammarly\n",
"company\n",
"•\n",
"10 models\n",
"•\n",
"120 followers\n",
"Writer\n",
"Enterprise\n",
"company\n",
"•\n",
"19 models\n",
"•\n",
"203 followers\n",
"Our Open Source\n",
"We are building the foundation of ML tooling with the community.\n",
"Transformers\n",
"138,457\n",
"State-of-the-art ML for Pytorch, TensorFlow, and JAX.\n",
"Diffusers\n",
"27,351\n",
"State-of-the-art diffusion models for image and audio generation in PyTorch.\n",
"Safetensors\n",
"3,049\n",
"Simple, safe way to store and distribute neural networks weights safely and quickly.\n",
"Hub Python Library\n",
"2,288\n",
"Client library for the HF Hub: manage repositories from your Python runtime.\n",
"Tokenizers\n",
"9,320\n",
"Fast tokenizers, optimized for both research and production.\n",
"PEFT\n",
"17,127\n",
"Parameter efficient finetuning methods for large models.\n",
"Transformers.js\n",
"12,786\n",
"State-of-the-art Machine Learning for the web. Run Transformers directly in your browser, with no need for a server.\n",
"timm\n",
"33,042\n",
"State-of-the-art computer vision models, layers, optimizers, training/evaluation, and utilities.\n",
"TRL\n",
"10,982\n",
"Train transformer language models with reinforcement learning.\n",
"Datasets\n",
"19,535\n",
"Access and share datasets for computer vision, audio, and NLP tasks.\n",
"Text Generation Inference\n",
"9,685\n",
"Toolkit to serve Large Language Models.\n",
"Accelerate\n",
"8,253\n",
"Easily train and use 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",
"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",
"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",
"281 models\n",
"•\n",
"13.3k followers\n",
"Nerdy Face\n",
"Enterprise\n",
"company\n",
"•\n",
"1 model\n",
"•\n",
"273 followers\n",
"Orange\n",
"Enterprise\n",
"company\n",
"•\n",
"4 models\n",
"•\n",
"163 followers\n",
"ServiceNow-AI\n",
"Enterprise\n",
"company\n",
"•\n",
"142 followers\n",
"Fidelity Investments\n",
"Enterprise\n",
"company\n",
"•\n",
"122 followers\n",
"Xsolla\n",
"Enterprise\n",
"company\n",
"•\n",
"77 followers\n",
"Mistral AI_\n",
"Enterprise\n",
"company\n",
"•\n",
"23 models\n",
"•\n",
"4.56k followers\n",
"IBM Granite\n",
"Enterprise\n",
"company\n",
"•\n",
"71 models\n",
"•\n",
"881 followers\n",
"Stability AI\n",
"Enterprise\n",
"company\n",
"•\n",
"99 models\n",
"•\n",
"13.9k followers\n",
"creditkarma\n",
"Enterprise\n",
"company\n",
"•\n",
"41 followers\n",
"HiddenLayer\n",
"Enterprise\n",
"company\n",
"•\n",
"53 followers\n",
"Ekimetrics\n",
"Enterprise\n",
"company\n",
"•\n",
"50 followers\n",
"Widn AI\n",
"Enterprise\n",
"company\n",
"•\n",
"35 followers\n",
"Adyen\n",
"Enterprise\n",
"company\n",
"•\n",
"39 followers\n",
"Meta Llama\n",
"Enterprise\n",
"company\n",
"•\n",
"57 models\n",
"•\n",
"23.5k followers\n",
"AI at Meta\n",
"Enterprise\n",
"company\n",
"•\n",
"2.06k models\n",
"•\n",
"4.36k followers\n",
"Together\n",
"Enterprise\n",
"company\n",
"•\n",
"31 models\n",
"•\n",
"499 followers\n",
"Writer\n",
"Enterprise\n",
"company\n",
"•\n",
"19 models\n",
"•\n",
"203 followers\n",
"Bloomberg\n",
"Enterprise\n",
"company\n",
"•\n",
"2 models\n",
"•\n",
"142 followers\n",
"H2O.ai\n",
"Enterprise\n",
"company\n",
"•\n",
"71 models\n",
"•\n",
"376 followers\n",
"Technology Innovation Institute\n",
"Enterprise\n",
"company\n",
"•\n",
"64 models\n",
"•\n",
"1.17k followers\n",
"Chegg Inc\n",
"Enterprise\n",
"company\n",
"•\n",
"82 followers\n",
"Mercedes-Benz AG\n",
"Enterprise\n",
"company\n",
"•\n",
"100 followers\n",
"Liberty Mutual\n",
"Enterprise\n",
"company\n",
"•\n",
"43 followers\n",
"Johnson & Johnson\n",
"Enterprise\n",
"company\n",
"•\n",
"40 followers\n",
"Gretel.ai\n",
"Enterprise\n",
"company\n",
"•\n",
"8 models\n",
"•\n",
"91 followers\n",
"BCG X\n",
"Enterprise\n",
"company\n",
"•\n",
"31 followers\n",
"Qualcomm\n",
"Enterprise\n",
"company\n",
"•\n",
"156 models\n",
"•\n",
"405 followers\n",
"Shopify\n",
"Enterprise\n",
"company\n",
"•\n",
"392 followers\n",
"AMD\n",
"Enterprise\n",
"company\n",
"•\n",
"77 models\n",
"•\n",
"1.22k followers\n",
"Arm\n",
"Enterprise\n",
"company\n",
"•\n",
"131 followers\n",
"Toyota Research Institute\n",
"Enterprise\n",
"company\n",
"•\n",
"10 models\n",
"•\n",
"96 followers\n",
"Deutsche Telekom AG\n",
"Enterprise\n",
"company\n",
"•\n",
"7 models\n",
"•\n",
"119 followers\n",
"Jusbrasil\n",
"Enterprise\n",
"company\n",
"•\n",
"78 followers\n",
"Aledade Inc\n",
"Enterprise\n",
"company\n",
"•\n",
"58 followers\n",
"Virtusa Corporation\n",
"Enterprise\n",
"company\n",
"•\n",
"57 followers\n",
"Arcee AI\n",
"Enterprise\n",
"company\n",
"•\n",
"146 models\n",
"•\n",
"352 followers\n",
"Nutanix\n",
"Enterprise\n",
"company\n",
"•\n",
"247 models\n",
"•\n",
"43 followers\n",
"MiniMax\n",
"Enterprise\n",
"company\n",
"•\n",
"2 models\n",
"•\n",
"498 followers\n",
"Kakao Corp.\n",
"Enterprise\n",
"company\n",
"•\n",
"45 followers\n",
"Hover External\n",
"Enterprise\n",
"company\n",
"•\n",
"30 followers\n",
"Liquid AI\n",
"Enterprise\n",
"company\n",
"•\n",
"98 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",
"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",
"The AI tools for Art Newsletter - Issue 1\n",
"By\n",
"linoyts\n",
"January 31, 2025\n",
"•\n",
"33\n",
"Community Articles\n",
"view all\n",
"Problem Solving with Language Models\n",
"By\n",
"haritzpuerto\n",
"•\n",
"about 7 hours ago\n",
"•\n",
"1\n",
"🦸🏻#9: Does AI Remember? The Role of Memory in Agentic Workflows\n",
"By\n",
"Kseniase\n",
"•\n",
"about 9 hours ago\n",
"•\n",
"1\n",
"🚀 Deploying OLMo-7B with Text Generation Inference (TGI) on Hugging Face Spaces\n",
"By\n",
"ariG23498\n",
"•\n",
"about 9 hours ago\n",
"o3-mini vs Deepseek-R1\n",
"By\n",
"prithivMLmods\n",
"•\n",
"about 16 hours ago\n",
"•\n",
"11\n",
"Activation Steering: A New Frontier in AI Control—But Does It Scale?\n",
"By\n",
"royswastik\n",
"•\n",
"about 21 hours ago\n",
"Open-R1: Update #1\n",
"By\n",
"open-r1\n",
"•\n",
"1 day ago\n",
"•\n",
"109\n",
"The AHA Indicator\n",
"By\n",
"etemiz\n",
"•\n",
"1 day ago\n",
"•\n",
"1\n",
"LLM Dataset Formats 101: A No‐BS Guide for Hugging Face Devs\n",
"By\n",
"tegridydev\n",
"•\n",
"2 days ago\n",
"•\n",
"3\n",
"Why we (don't) need export control\n",
"By\n",
"as-cle-bert\n",
"•\n",
"2 days ago\n",
"•\n",
"7\n",
"AI Agents for Trip Planning: Automating Itinerary Generation with KaibanJS\n",
"By\n",
"darielnoel\n",
"•\n",
"2 days ago\n",
"Replicating DeepSeek R1 for Information Extraction\n",
"By\n",
"Ihor\n",
"•\n",
"2 days ago\n",
"•\n",
"17\n",
"Enhancing AI Agents with the TextFile RAG Search Tool in KaibanJS\n",
"By\n",
"darielnoel\n",
"•\n",
"2 days ago\n",
"Mini-R1: Reproduce Deepseek R1 „aha moment“ a RL tutorial\n",
"By\n",
"open-r1\n",
"•\n",
"3 days ago\n",
"•\n",
"21\n",
"The Power of Open-Source AI\n",
"By\n",
"mediiiiii3\n",
"•\n",
"3 days ago\n",
"The Power of Open-Source AI\n",
"By\n",
"mediiiiii3\n",
"•\n",
"3 days ago\n",
"Introduction to Artificial Intelligence\n",
"By\n",
"mediiiiii\n",
"•\n",
"3 days ago\n",
"Opensource Low Resource Language Datasets to Supervised Finetune Language Models\n",
"By\n",
"jojo-ai-mst\n",
"•\n",
"3 days ago\n",
"•\n",
"1\n",
"🦸🏻#8: Rewriting the Rules of Knowledge: How Modern Agents Learn to Adapt\n",
"By\n",
"Kseniase\n",
"•\n",
"3 days ago\n",
"•\n",
"5\n",
"**The Copyright Office Draws a Line in Silicon: AI and the Soul of Creation**\n",
"By\n",
"fuzzy-mittenz\n",
"•\n",
"3 days ago\n",
"•\n",
"2\n",
"How to run Sentient’s Dobby-Mini locally with Ollama\n",
"By\n",
"chrisaubin\n",
"•\n",
"3 days ago\n",
"•\n",
"9\n",
"How to deploy and fine-tune DeepSeek models on AWS\n",
"By\n",
"pagezyhf\n",
"January 30, 2025\n",
"•\n",
"24\n",
"Welcome to Inference Providers on the Hub 🔥\n",
"By\n",
"burkaygur\n",
"January 28, 2025\n",
"•\n",
"204\n",
"Open-R1: a fully open reproduction of DeepSeek-R1\n",
"By\n",
"eliebak\n",
"January 28, 2025\n",
"•\n",
"558\n",
"State of open video generation models in Diffusers\n",
"By\n",
"sayakpaul\n",
"January 27, 2025\n",
"•\n",
"27\n",
"We now support VLMs in smolagents!\n",
"By\n",
"m-ric\n",
"January 24, 2025\n",
"•\n",
"68\n",
"SmolVLM Grows Smaller – Introducing the 250M & 500M Models!\n",
"By\n",
"andito\n",
"January 23, 2025\n",
"•\n",
"104\n",
"Hugging Face and FriendliAI partner to supercharge model deployment on the Hub\n",
"By\n",
"ajshinfai\n",
"January 22, 2025\n",
"•\n",
"29\n",
"Timm ❤ Transformers: Use any timm model with transformers\n",
"By\n",
"ariG23498\n",
"January 16, 2025\n",
"•\n",
"37\n",
"Introducing multi-backends (TRT-LLM, vLLM) support for Text Generation Inference\n",
"By\n",
"mfuntowicz\n",
"January 16, 2025\n",
"•\n",
"62\n",
"Train 400x faster Static Embedding Models with Sentence Transformers\n",
"By\n",
"tomaarsen\n",
"January 15, 2025\n",
"•\n",
"131\n",
"Run ComfyUI workflows for free on Spaces\n",
"By\n",
"multimodalart\n",
"January 14, 2024\n",
"•\n",
"48\n",
"AI Agents Are Here. What Now?\n",
"By\n",
"meg\n",
"January 13, 2025\n",
"•\n",
"55\n",
"Visual Document Retrieval Goes Multilingual\n",
"By\n",
"marco\n",
"January 10, 2025\n",
"guest\n",
"•\n",
"66\n",
"CO₂ Emissions and Models Performance: Insights from the Open LLM Leaderboard\n",
"By\n",
"alozowski\n",
"January 9, 2025\n",
"•\n",
"16\n",
"Previous\n",
"1\n",
"2\n",
"3\n",
"...\n",
"38\n",
"Next\n",
"Community Articles\n",
"view all\n",
"Problem Solving with Language Models\n",
"By\n",
"haritzpuerto\n",
"•\n",
"about 7 hours ago\n",
"•\n",
"1\n",
"🦸🏻#9: Does AI Remember? The Role of Memory in Agentic Workflows\n",
"By\n",
"Kseniase\n",
"•\n",
"about 9 hours ago\n",
"•\n",
"1\n",
"🚀 Deploying OLMo-7B with Text Generation Inference (TGI) on Hugging Face Spaces\n",
"By\n",
"ariG23498\n",
"•\n",
"about 9 hours ago\n",
"o3-mini vs Deepseek-R1\n",
"By\n",
"prithivMLmods\n",
"•\n",
"about 16 hours ago\n",
"•\n",
"11\n",
"Activation Steering: A New Frontier in AI Control—But Does It Scale?\n",
"By\n",
"royswastik\n",
"•\n",
"about 21 hours ago\n",
"Open-R1: Update #1\n",
"By\n",
"open-r1\n",
"•\n",
"1 day ago\n",
"•\n",
"109\n",
"The AHA Indicator\n",
"By\n",
"etemiz\n",
"•\n",
"1 day ago\n",
"•\n",
"1\n",
"LLM Dataset Formats 101: A No‐BS Guide for Hugging Face Devs\n",
"By\n",
"tegridydev\n",
"•\n",
"2 days ago\n",
"•\n",
"3\n",
"Why we (don't) need export control\n",
"By\n",
"as-cle-bert\n",
"•\n",
"2 days ago\n",
"•\n",
"7\n",
"AI Agents for Trip Planning: Automating Itinerary Generation with KaibanJS\n",
"By\n",
"darielnoel\n",
"•\n",
"2 days ago\n",
"Replicating DeepSeek R1 for Information Extraction\n",
"By\n",
"Ihor\n",
"•\n",
"2 days ago\n",
"•\n",
"17\n",
"Enhancing AI Agents with the TextFile RAG Search Tool in KaibanJS\n",
"By\n",
"darielnoel\n",
"•\n",
"2 days ago\n",
"Mini-R1: Reproduce Deepseek R1 „aha moment“ a RL tutorial\n",
"By\n",
"open-r1\n",
"•\n",
"3 days ago\n",
"•\n",
"21\n",
"The Power of Open-Source AI\n",
"By\n",
"mediiiiii3\n",
"•\n",
"3 days ago\n",
"The Power of Open-Source AI\n",
"By\n",
"mediiiiii3\n",
"•\n",
"3 days ago\n",
"Introduction to Artificial Intelligence\n",
"By\n",
"mediiiiii\n",
"•\n",
"3 days ago\n",
"Opensource Low Resource Language Datasets to Supervised Finetune Language Models\n",
"By\n",
"jojo-ai-mst\n",
"•\n",
"3 days ago\n",
"•\n",
"1\n",
"🦸🏻#8: Rewriting the Rules of Knowledge: How Modern Agents Learn to Adapt\n",
"By\n",
"Kseniase\n",
"•\n",
"3 days ago\n",
"•\n",
"5\n",
"**The Copyright Office Draws a Line in Silicon: AI and the Soul of Creation**\n",
"By\n",
"fuzzy-mittenz\n",
"•\n",
"3 days ago\n",
"•\n",
"2\n",
"How to run Sentient’s Dobby-Mini locally with Ollama\n",
"By\n",
"chrisaubin\n",
"•\n",
"3 days ago\n",
"•\n",
"9\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",
"community page\n",
"Webpage Title:\n",
"Hugging Face Forums - Hugging Face Community Discussion\n",
"Webpage Contents:\n",
"Hugging Face Forums\n",
"Topic\n",
"Replies\n",
"Views\n",
"Activity\n",
"Some HF operations take an excessively long time to complete\n",
"Beginners\n",
"7\n",
"2561\n",
"February 2, 2025\n",
"Best way to deploy a SLM/LLM model. Best library and approach?\n",
"Research\n",
"5\n",
"28\n",
"February 2, 2025\n",
"Why is api-enterprise@huggingface.co not responding my emails?\n",
"Beginners\n",
"1\n",
"5\n",
"February 2, 2025\n",
"Incorrect Cross Attention Values from Generate Function of ORTModelForVision2Seq\n",
"🤗Optimum\n",
"3\n",
"16\n",
"February 1, 2025\n",
"Add Intel Core Ultra and Snapdragon X Elite to the CPUs in \"Local Apps and Hardware\"?\n",
"🤗Hub\n",
"1\n",
"8\n",
"February 2, 2025\n",
"Inference API turned off ? Why?\n",
"Site Feedback\n",
"32\n",
"1123\n",
"February 2, 2025\n",
"Hugging face private model error in replicate\n",
"Beginners\n",
"2\n",
"94\n",
"February 2, 2025\n",
"meta-llama/Llama-2-7b-chat-hf weird responses, compared to the ones returned by the HF API\n",
"🤗Transformers\n",
"1\n",
"4\n",
"February 2, 2025\n",
"RewardTrainer Problem\n",
"🤗AutoTrain\n",
"6\n",
"38\n",
"February 1, 2025\n",
"My dataset is 250 docs, is multiple hours tuning normal?\n",
"Beginners\n",
"17\n",
"188\n",
"January 29, 2025\n",
"Fail to deploy newer models\n",
"Inference Endpoints on the Hub\n",
"3\n",
"21\n",
"January 31, 2025\n",
"Getting 401 Unauthorized while downloading models via Tabby\n",
"Beginners\n",
"2\n",
"29\n",
"February 1, 2025\n",
"High variability of CPU inference times\n",
"Beginners\n",
"4\n",
"19\n",
"January 30, 2025\n",
"Looking for help to use AI (LLM) for a Systematic Literature Review in Soil Biodiversity/agroecology Research\n",
"Research\n",
"4\n",
"49\n",
"February 1, 2025\n",
"Help for Non-programmers/non-coders\n",
"Beginners\n",
"14\n",
"84\n",
"February 2, 2025\n",
"Even though I have the paid version, when I try to download the textured mesh, it shows \"File was not available on site.\"\n",
"Beginners\n",
"1\n",
"18\n",
"February 1, 2025\n",
"Initialize model with empty weight causes OOM with offloading to disk\n",
"Beginners\n",
"0\n",
"4\n",
"February 1, 2025\n",
"I think I found a bug on HF datasets tab\n",
"Beginners\n",
"5\n",
"19\n",
"February 1, 2025\n",
"Inference API Usage Not Updating in Billing Overview (Pro Plan)\n",
"Beginners\n",
"1\n",
"16\n",
"February 1, 2025\n",
"Increase quota for Inference Endpoint\n",
"Inference Endpoints on the Hub\n",
"4\n",
"39\n",
"January 31, 2025\n",
"Understanding where model weights are stored for research project on AI openness\n",
"Research\n",
"3\n",
"60\n",
"January 31, 2025\n",
"Download DeepSeek R1 685B locally for future fine tuneing\n",
"🤗Transformers\n",
"1\n",
"176\n",
"January 31, 2025\n",
"Cannot download models\n",
"Beginners\n",
"5\n",
"57\n",
"January 31, 2025\n",
"Can't access HF discord after verification, been trying over a month\n",
"Community Calls\n",
"6\n",
"62\n",
"January 28, 2025\n",
"Log out Button for HuggingFace\n",
"Beginners\n",
"1\n",
"12\n",
"February 1, 2025\n",
"Is the HF chat down?\n",
"Beginners\n",
"3\n",
"64\n",
"January 30, 2025\n",
"CSV Competition - Cannot reach Hugging Face Hub\n",
"🤗Hub\n",
"3\n",
"14\n",
"February 1, 2025\n",
"Archived versions of Open LLM Leaderboard\n",
"Beginners\n",
"1\n",
"16\n",
"February 1, 2025\n",
"How to access Gradio components created dynamically in a global function\n",
"Beginners\n",
"5\n",
"15\n",
"February 1, 2025\n",
"Space Not Able to Pull from Model Library\n",
"Spaces\n",
"2\n",
"10\n",
"February 1, 2025\n",
"next page →\n",
"Home\n",
"Categories\n",
"Guidelines\n",
"Terms of Service\n",
"Privacy Policy\n",
"Powered by\n",
"Discourse\n",
", best viewed with JavaScript enabled\n",
"\n",
"\n",
"\n",
"Github page\n",
"Webpage Title:\n",
"Hugging Face · GitHub\n",
"Webpage Contents:\n",
"Skip to content\n",
"Navigation Menu\n",
"Toggle navigation\n",
"Sign in\n",
"huggingface\n",
"Product\n",
"GitHub Copilot\n",
"Write better code with AI\n",
"Security\n",
"Find and fix vulnerabilities\n",
"Actions\n",
"Automate any workflow\n",
"Codespaces\n",
"Instant dev environments\n",
"Issues\n",
"Plan and track work\n",
"Code Review\n",
"Manage code changes\n",
"Discussions\n",
"Collaborate outside of code\n",
"Code Search\n",
"Find more, search less\n",
"Explore\n",
"All features\n",
"Documentation\n",
"GitHub Skills\n",
"Blog\n",
"Solutions\n",
"By company size\n",
"Enterprises\n",
"Small and medium teams\n",
"Startups\n",
"Nonprofits\n",
"By use case\n",
"DevSecOps\n",
"DevOps\n",
"CI/CD\n",
"View all use cases\n",
"By industry\n",
"Healthcare\n",
"Financial services\n",
"Manufacturing\n",
"Government\n",
"View all industries\n",
"View all solutions\n",
"Resources\n",
"Topics\n",
"AI\n",
"DevOps\n",
"Security\n",
"Software Development\n",
"View all\n",
"Explore\n",
"Learning Pathways\n",
"White papers, Ebooks, Webinars\n",
"Customer Stories\n",
"Partners\n",
"Executive Insights\n",
"Open Source\n",
"GitHub Sponsors\n",
"Fund open source developers\n",
"The ReadME Project\n",
"GitHub community articles\n",
"Repositories\n",
"Topics\n",
"Trending\n",
"Collections\n",
"Enterprise\n",
"Enterprise platform\n",
"AI-powered developer platform\n",
"Available add-ons\n",
"Advanced Security\n",
"Enterprise-grade security features\n",
"GitHub Copilot\n",
"Enterprise-grade AI features\n",
"Premium Support\n",
"Enterprise-grade 24/7 support\n",
"Pricing\n",
"Search or jump to...\n",
"Search code, repositories, users, issues, pull requests...\n",
"Search\n",
"Clear\n",
"Search syntax tips\n",
"Provide feedback\n",
"We read every piece of feedback, and take your input very seriously.\n",
"Include my email address so I can be contacted\n",
"Cancel\n",
"Submit feedback\n",
"Saved searches\n",
"Use saved searches to filter your results more quickly\n",
"Cancel\n",
"Create saved search\n",
"Sign in\n",
"Sign up\n",
"Reseting focus\n",
"You signed in with another tab or window.\n",
"Reload\n",
"to refresh your session.\n",
"You signed out in another tab or window.\n",
"Reload\n",
"to refresh your session.\n",
"You switched accounts on another tab or window.\n",
"Reload\n",
"to refresh your session.\n",
"Dismiss alert\n",
"Hugging Face\n",
"The AI community building the future.\n",
"Verified\n",
"We've verified that the organization\n",
"huggingface\n",
"controls the domain:\n",
"huggingface.co\n",
"Learn more about verified organizations\n",
"42.8k\n",
"followers\n",
"NYC + Paris\n",
"https://huggingface.co/\n",
"X\n",
"@huggingface\n",
"Overview\n",
"Repositories\n",
"Projects\n",
"Packages\n",
"People\n",
"Sponsoring\n",
"0\n",
"More\n",
"Overview\n",
"Repositories\n",
"Projects\n",
"Packages\n",
"People\n",
"Sponsoring\n",
"Pinned\n",
"Loading\n",
"transformers\n",
"transformers\n",
"Public\n",
"🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.\n",
"Python\n",
"138k\n",
"27.8k\n",
"diffusers\n",
"diffusers\n",
"Public\n",
"🤗 Diffusers: State-of-the-art diffusion models for image, video, and audio generation in PyTorch and FLAX.\n",
"Python\n",
"27.4k\n",
"5.6k\n",
"datasets\n",
"datasets\n",
"Public\n",
"🤗 The largest hub of ready-to-use datasets for ML models with fast, easy-to-use and efficient data manipulation tools\n",
"Python\n",
"19.5k\n",
"2.7k\n",
"peft\n",
"peft\n",
"Public\n",
"🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.\n",
"Python\n",
"17.1k\n",
"1.7k\n",
"accelerate\n",
"accelerate\n",
"Public\n",
"🚀 A simple way to launch, train, and use PyTorch models on almost any device and distributed configuration, automatic mixed precision (including fp8), and easy-to-configure FSDP and DeepSpeed support\n",
"Python\n",
"8.3k\n",
"1k\n",
"optimum\n",
"optimum\n",
"Public\n",
"🚀 Accelerate inference and training of 🤗 Transformers, Diffusers, TIMM and Sentence Transformers with easy to use hardware optimization tools\n",
"Python\n",
"2.7k\n",
"494\n",
"Repositories\n",
"Loading\n",
"Type\n",
"Select type\n",
"Forks\n",
"Archived\n",
"Mirrors\n",
"Templates\n",
"Language\n",
"Select language\n",
"All\n",
"C\n",
"C#\n",
"C++\n",
"Cuda\n",
"Dockerfile\n",
"Go\n",
"Handlebars\n",
"HTML\n",
"Java\n",
"JavaScript\n",
"Jupyter Notebook\n",
"Kotlin\n",
"Lua\n",
"MDX\n",
"Mustache\n",
"Nix\n",
"Python\n",
"Rust\n",
"Shell\n",
"Smarty\n",
"Swift\n",
"TypeScript\n",
"Sort\n",
"Select order\n",
"Last updated\n",
"Name\n",
"Stars\n",
"Showing 10 of 286 repositories\n",
"trl\n",
"Public\n",
"Train transformer language models with reinforcement learning.\n",
"huggingface/trl’s past year of commit activity\n",
"Python\n",
"10,982\n",
"Apache-2.0\n",
"1,460\n",
"178\n",
"55\n",
"Updated\n",
"Feb 2, 2025\n",
"smolagents\n",
"Public\n",
"🤗 smolagents: a barebones library for agents. Agents write python code to call tools and orchestrate other agents.\n",
"huggingface/smolagents’s past year of commit activity\n",
"Python\n",
"6,232\n",
"Apache-2.0\n",
"588\n",
"96\n",
"36\n",
"Updated\n",
"Feb 2, 2025\n",
"lerobot\n",
"Public\n",
"🤗 LeRobot: Making AI for Robotics more accessible with end-to-end learning\n",
"huggingface/lerobot’s past year of commit activity\n",
"Python\n",
"8,430\n",
"Apache-2.0\n",
"890\n",
"92\n",
"92\n",
"Updated\n",
"Feb 2, 2025\n",
"text-generation-inference\n",
"Public\n",
"Large Language Model Text Generation Inference\n",
"huggingface/text-generation-inference’s past year of commit activity\n",
"Python\n",
"9,685\n",
"Apache-2.0\n",
"1,135\n",
"195\n",
"21\n",
"Updated\n",
"Feb 2, 2025\n",
"candle\n",
"Public\n",
"Minimalist ML framework for Rust\n",
"huggingface/candle’s past year of commit activity\n",
"Rust\n",
"16,444\n",
"Apache-2.0\n",
"1,014\n",
"361\n",
"(5 issues need help)\n",
"92\n",
"Updated\n",
"Feb 1, 2025\n",
"diffusers\n",
"Public\n",
"🤗 Diffusers: State-of-the-art diffusion models for image, video, and audio generation in PyTorch and FLAX.\n",
"huggingface/diffusers’s past year of commit activity\n",
"Python\n",
"27,351\n",
"Apache-2.0\n",
"5,610\n",
"398\n",
"(12 issues need help)\n",
"166\n",
"Updated\n",
"Feb 1, 2025\n",
"huggingface_hub\n",
"Public\n",
"The official Python client for the Huggingface Hub.\n",
"huggingface/huggingface_hub’s past year of commit activity\n",
"Python\n",
"2,288\n",
"Apache-2.0\n",
"605\n",
"148\n",
"(6 issues need help)\n",
"18\n",
"Updated\n",
"Feb 1, 2025\n",
"smollm\n",
"Public\n",
"Everything about the SmolLM2 and SmolVLM family of models\n",
"huggingface/smollm’s past year of commit activity\n",
"Python\n",
"1,768\n",
"Apache-2.0\n",
"101\n",
"10\n",
"1\n",
"Updated\n",
"Feb 1, 2025\n",
"optimum-habana\n",
"Public\n",
"Easy and lightning fast training of 🤗 Transformers on Habana Gaudi processor (HPU)\n",
"huggingface/optimum-habana’s past year of commit activity\n",
"Python\n",
"166\n",
"Apache-2.0\n",
"225\n",
"14\n",
"(1 issue needs help)\n",
"37\n",
"Updated\n",
"Feb 1, 2025\n",
"xet-core\n",
"Public\n",
"xet client tech, used in huggingface_hub\n",
"huggingface/xet-core’s past year of commit activity\n",
"Rust\n",
"5\n",
"Apache-2.0\n",
"2\n",
"0\n",
"5\n",
"Updated\n",
"Feb 1, 2025\n",
"View all repositories\n",
"People\n",
"View all\n",
"Top languages\n",
"Python\n",
"Jupyter Notebook\n",
"Rust\n",
"TypeScript\n",
"JavaScript\n",
"Most used topics\n",
"pytorch\n",
"machine-learning\n",
"nlp\n",
"deep-learning\n",
"transformers\n",
"Footer\n",
"© 2025 GitHub, Inc.\n",
"Footer navigation\n",
"Terms\n",
"Privacy\n",
"Security\n",
"Status\n",
"Docs\n",
"Contact\n",
"Manage cookies\n",
"Do not share my personal information\n",
"You can’t perform that action at this time.\n",
"\n",
"\n",
"\n",
"LinkedIn page\n",
"Webpage Title:\n",
"Hugging Face | LinkedIn\n",
"Webpage Contents:\n",
"Skip to main content\n",
"LinkedIn\n",
"Articles\n",
"People\n",
"Learning\n",
"Jobs\n",
"Games\n",
"Get the app\n",
"Join now\n",
"Sign in\n",
"Hugging Face\n",
"Software Development\n",
"The AI community building the future.\n",
"See jobs\n",
"Follow\n",
"View all 498 employees\n",
"Report this company\n",
"About us\n",
"The AI community building the future.\n",
"Website\n",
"https://huggingface.co\n",
"External link for Hugging Face\n",
"Industry\n",
"Software Development\n",
"Company size\n",
"51-200 employees\n",
"Type\n",
"Privately Held\n",
"Founded\n",
"2016\n",
"Specialties\n",
"machine learning, natural language processing, and deep learning\n",
"Products\n",
"Hugging Face\n",
"Hugging Face\n",
"Natural Language Processing (NLP) Software\n",
"We’re on a journey to solve and democratize artificial intelligence through natural language.\n",
"Locations\n",
"Primary\n",
"Get directions\n",
"Paris, FR\n",
"Get directions\n",
"Employees at Hugging Face\n",
"Ludovic Huraux\n",
"Bassem ASSEH\n",
"Rajat Arya\n",
"Tech Lead & Software Engineer @ HF | prev: co-founder XetHub, Apple, Turi, AWS, Microsoft\n",
"Jeff Boudier\n",
"Product + Growth at Hugging Face\n",
"See all employees\n",
"Updates\n",
"Hugging Face\n",
"reposted this\n",
"Daniel van Strien\n",
"Machine Learning Librarian@🤗 | Championing Open Science & Machine Learning\n",
"6h\n",
"Report this post\n",
"Three nice dataset releases from this Week on\n",
"Hugging Face\n",
"Hub: \n",
"\n",
"**SCP-116K**\n",
"\n",
"A comprehensive scientific reasoning dataset with 116K+ university to PhD-level problems across physics, chemistry, and biology. Perfect for training models in structured scientific problem-solving.\n",
"https://lnkd.in/eHnqnYvc\n",
"**Dolphin-R1**\n",
"\n",
" n 800K sample dataset combining insights from DeepSeek-R1, Gemini 2.0 flash thinking, and Dolphin chat, designed specifically for training R1-style reasoning models.\n",
"https://lnkd.in/e44Kjq4U\n",
"**WildChat-50M**\n",
"The largest open chat dataset to date, featuring 125M+ transcripts and demonstrating 40% better efficiency than existing benchmarks. Built to enhance conversational reasoning.\n",
"https://lnkd.in/eh-mYSpX\n",
"All datasets are available on 🤗\n",
"EricLu/SCP-116K · Datasets at Hugging Face\n",
"huggingface.co\n",
"51\n",
"1 Comment\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Merve Noyan\n",
"open-sourceress at 🤗 | Google Developer Expert in Machine Learning, MSc Candidate in Data Science\n",
"2d\n",
"Report this post\n",
"run powerful AI agents in one line of CLI command 🔥\n",
"you can now run tool-calling AI agents or web automation agents through CLI in smolagents 😏\n",
"get started as easily as `$ webagent {prompt}` in CLI, see below an example where I browse in an e-commerce website ⬇\n",
"\n",
"\n",
"tool-calling agents are ran with $ smolagent {prompt} \n",
"\n",
"for instance, try planning a trip with $ smolagent \"Plan a trip to Tokyo, Kyoto and Osaka between Mar 28 and Apr 7. Allocate time according to number of public attraction in each, and optimize for distance and travel time. Bring all the public transportation options.\"\n",
"\n",
"we give you access to thousands of AI models (speech-to-text, document parsing and more) and several APIs as tools out-of-the-box, so get creative 🧑🏻🎨\n",
"\n",
"get started with $ pip install -U smolagents\n",
"…more\n",
"221\n",
"10 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Gradio\n",
"54,296 followers\n",
"3d\n",
"Report this post\n",
"Gradio is committed to a secure, intuitive experience for every developer. Check out the full story of how we’re raising the bar for open-source ML security - Refer our case study linked here:\n",
"https://lnkd.in/g68nziRX\n",
"Trail of Bits\n",
"9,705 followers\n",
"3d\n",
"Edited\n",
"AI/ML security requires a unique blend of expertise that goes beyond traditional application security. We recently completed a comprehensive review of\n",
"Gradio\n",
"5, a machine learning platform that helps even beginner devs easily build and share ML applications.\n",
"\n",
"Read the case study:\n",
"https://hubs.la/Q034HN7p0\n",
"Our assessment identified 27 unique vulnerabilities across Python, JavaScript, and Go codebases - all of which were remediated before release.\n",
"\n",
"The engagement demonstrated how AI/ML vulnerabilities differ fundamentally from conventional software bugs. Securing ML infrastructure demands deep understanding of both application security and machine learning architecture to deliver practical security controls without compromising developer and user experience. Our evaluation spanned local development environments, production deployments, and sharing infrastructure.\n",
"\n",
"The Gradio team's commitment to security enabled them to improve their platform's security posture while maintaining the intuitive interface that serves their growing developer community.\n",
"15\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Philipp Schmid\n",
"Technical Lead & LLMs at Hugging Face 🤗 | AWS ML HERO 🦸🏻♂\n",
"3d\n",
"Edited\n",
"Report this post\n",
"Mini-R1: Reproduce\n",
"DeepSeek AI\n",
"R1 „aha moment“ a RL tutorial! Recreate an RL \"aha moment\" using Group Relative Policy Optimization (GRPO) and train an open model using reinforcement learning to teach it self-verification and search abilities all on its own to solve the Countdown Game.\n",
"\n",
"TL;DR:\n",
"🤯 DeepSeek R1's \"aha moment\" demonstrates RL's potential for self-improvement in LLMs.\n",
"2 Using 2 reward functions, 1x for format (<think>,<answer>) and 1x for correctness\n",
"🤖 Qwen2.5-3B-Instruct model learns self-verification and search abilities.\n",
"⚙ Use DeepSpeed and vLLM for efficient and distributed online RL Training with\n",
"Hugging Face\n",
"TRL\n",
"🤟 Include Training Observations and Hyperparameter improvements\n",
"🧮 Uses Countdown Game (arithmetic puzzles) to teach models self-correction via <think> and <answer> tags\n",
"📊 Achieves 50% success rate after 450 training steps on 4x H100 GPUs\n",
"⚡ Training takes ~6 hours on 4x H100 GPUs for 450 steps\n",
"\n",
"Blog:\n",
"https://lnkd.in/eC2fRTvu\n",
"1,099\n",
"33 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Clem Delangue 🤗\n",
"Clem Delangue 🤗 is an Influencer\n",
"Co-founder & CEO at Hugging Face\n",
"4d\n",
"Report this post\n",
"The beauty of open-source is that it can make its way to enterprise safely in record times! \n",
"\n",
"Happy to announce that\n",
"DeepSeek AI\n",
"R1 is now available on-premise through our\n",
"Dell Technologies\n",
"/\n",
"Hugging Face\n",
"collaboration. Cheers\n",
"Michael Dell\n",
"!\n",
"3,103\n",
"130 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Gradio\n",
"54,296 followers\n",
"4d\n",
"Report this post\n",
"Build Agents that can Cite the sources that they are referring to so that you are sure your AI is not hallucinating! \n",
"\n",
"Best part? Zero prompt engineering needed.\n",
"Anthropic\n",
"'s Citations are built right into their API response format. Your AI responses now come with proof, showing exactly which parts of your documents support each claim! 🔍\n",
"\n",
"Learn more:\n",
"https://lnkd.in/gWk8Ad9Q\n",
"64\n",
"3 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Sayak Paul\n",
"ML @ Hugging Face 🤗\n",
"4d\n",
"Report this post\n",
"Last week, I had the opportunity to present a suite of memory optimization techniques for Flux at\n",
"Google Cloud\n",
"!\n",
"\n",
"Some of them are upcoming, while many have already been shipped. \n",
"\n",
"The objective was to present alternatives and let users choose their best bet!\n",
"\n",
"Slides are here:\n",
"https://lnkd.in/gcWeipGN\n",
"Thanks once again to\n",
"Prashanth Subrahmanyam\n",
"for pulling the event off!\n",
"120\n",
"14 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Sayak Paul\n",
"ML @ Hugging Face 🤗\n",
"6d\n",
"Report this post\n",
"We have authored a post to go over the state of video generation in the Diffusers ecosystem 🧨\n",
"\n",
"We cover the models supported, the knobs of optimizations our users can fire (a lot), fine-tuning, and more 🔥\n",
"\n",
"5-6GBs for HunyuanVideo, sky is the limit 🤗\n",
"\n",
"Read it here:\n",
"https://lnkd.in/gqNimMC6\n",
"State of open video generation models in Diffusers\n",
"huggingface.co\n",
"119\n",
"1 Comment\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Bloomberg Television\n",
"51,031 followers\n",
"5d\n",
"Report this post\n",
"Thomas Wolf\n",
", Chief Science Officer at\n",
"Hugging Face\n",
"says open-source models, like ones from\n",
"DeepSeek AI\n",
", can help to lift the progress of the whole AI field\n",
"https://trib.al/BvxOf3J\n",
"…more\n",
"The Power of Open-Sourced AI\n",
"219\n",
"5 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Hugging Face\n",
"reposted this\n",
"Clem Delangue 🤗\n",
"Clem Delangue 🤗 is an Influencer\n",
"Co-founder & CEO at Hugging Face\n",
"1w\n",
"Report this post\n",
"Our science team has started working on fully reproducing and open-sourcing R1 including training data, training scripts,... \n",
"\n",
"Full power of open source AI so that everyone all over the world can take advantage of AI progress! Will help debunk some myths I’m sure too. \n",
"\n",
"Thanks\n",
"DeepSeek AI\n",
"!\n",
"5,987\n",
"172 Comments\n",
"Like\n",
"Comment\n",
"Share\n",
"Join now to see what you are missing\n",
"Find people you know at Hugging Face\n",
"Browse recommended jobs for you\n",
"View all updates, news, and articles\n",
"Join now\n",
"Similar pages\n",
"Anthropic\n",
"Research Services\n",
"Mistral AI\n",
"Technology, Information and Internet\n",
"Paris, France\n",
"OpenAI\n",
"Research Services\n",
"San Francisco, CA\n",
"LangChain\n",
"Technology, Information and Internet\n",
"Perplexity\n",
"Software Development\n",
"San Francisco, California\n",
"Generative AI\n",
"Technology, Information and Internet\n",
"LlamaIndex\n",
"Technology, Information and Internet\n",
"San Francisco, California\n",
"Google DeepMind\n",
"Research Services\n",
"London, London\n",
"DeepLearning.AI\n",
"Software Development\n",
"Palo Alto, California\n",
"Cohere\n",
"Software Development\n",
"Toronto, Ontario\n",
"Show more similar pages\n",
"Show fewer similar pages\n",
"Browse jobs\n",
"Engineer jobs\n",
"555,845 open jobs\n",
"Machine Learning Engineer jobs\n",
"148,937 open jobs\n",
"Scientist jobs\n",
"48,969 open jobs\n",
"Software Engineer jobs\n",
"300,699 open jobs\n",
"Intern jobs\n",
"71,196 open jobs\n",
"Developer jobs\n",
"258,935 open jobs\n",
"Analyst jobs\n",
"694,057 open jobs\n",
"Intelligence Specialist jobs\n",
"7,156 open jobs\n",
"Manager jobs\n",
"1,880,925 open jobs\n",
"Data Scientist jobs\n",
"264,158 open jobs\n",
"Director jobs\n",
"1,220,357 open jobs\n",
"Associate jobs\n",
"1,091,945 open jobs\n",
"Python Developer jobs\n",
"46,642 open jobs\n",
"Evangelist jobs\n",
"5,068 open jobs\n",
"Data Engineer jobs\n",
"192,126 open jobs\n",
"Vice President jobs\n",
"235,270 open jobs\n",
"Quantitative Analyst jobs\n",
"19,570 open jobs\n",
"Program Manager jobs\n",
"243,900 open jobs\n",
"Data Science Specialist jobs\n",
"2,441 open jobs\n",
"Lead Software Engineer jobs\n",
"68,215 open jobs\n",
"Show more jobs like this\n",
"Show fewer jobs like this\n",
"Funding\n",
"Hugging Face\n",
"7 total rounds\n",
"Last Round\n",
"Series D\n",
"Feb 16, 2024\n",
"External Crunchbase Link for last round of funding\n",
"See more info on\n",
"crunchbase\n",
"More searches\n",
"More searches\n",
"Engineer jobs\n",
"Intern jobs\n",
"Machine Learning Engineer jobs\n",
"Software Engineer jobs\n",
"Scientist jobs\n",
"Developer jobs\n",
"Research Intern jobs\n",
"Analyst jobs\n",
"Intelligence Specialist jobs\n",
"Quantitative Analyst jobs\n",
"Technician jobs\n",
"Data Science Specialist jobs\n",
"Project Manager jobs\n",
"Summer Intern jobs\n",
"Manager jobs\n",
"Senior Staff Engineer jobs\n",
"PHD jobs\n",
"Trader jobs\n",
"Researcher jobs\n",
"Data Scientist jobs\n",
"Writer jobs\n",
"Data Analyst jobs\n",
"Product Designer jobs\n",
"Back End Developer jobs\n",
"Spring Intern jobs\n",
"Program Manager jobs\n",
"Technology Officer jobs\n",
"Software Intern jobs\n",
"Security Professional jobs\n",
"Senior Software Engineer jobs\n",
"Python Developer jobs\n",
"Engineering Manager jobs\n",
"Web Developer jobs\n",
"Graduate jobs\n",
"Full Stack Engineer jobs\n",
"Professor jobs\n",
"Head jobs\n",
"Verification Manager jobs\n",
"User Experience Designer jobs\n",
"Recruiter jobs\n",
"Chief Executive Officer jobs\n",
"Associate jobs\n",
"Support Developer jobs\n",
"Senior Firmware Engineer jobs\n",
"Marketing Manager jobs\n",
"Modeling Engineer jobs\n",
"Designer jobs\n",
"Automation Lead jobs\n",
"Options Trader jobs\n",
"Agile Coach jobs\n",
"Research Engineer jobs\n",
"Software Quality Assurance Analyst jobs\n",
"User Experience Manager jobs\n",
"Technical Intern jobs\n",
"Junior Network Engineer jobs\n",
"Information Technology Recruiter jobs\n",
"User Researcher jobs\n",
"Player jobs\n",
"Engineering Project Manager jobs\n",
"Digital Strategist jobs\n",
"LinkedIn\n",
"© 2025\n",
"About\n",
"Accessibility\n",
"User Agreement\n",
"Privacy Policy\n",
"Your California Privacy Choices\n",
"Cookie Policy\n",
"Copyright Policy\n",
"Brand Policy\n",
"Guest Controls\n",
"Community Guidelines\n",
"العربية (Arabic)\n",
"ব (Bangla)\n",
"Čeština (Czech)\n",
"Dansk (Danish)\n",
"Deutsch (German)\n",
"Ελληνικά (Greek)\n",
"English (English)\n",
"Español (Spanish)\n",
"فارسی (Persian)\n",
"Suomi (Finnish)\n",
"Français (French)\n",
"हि (Hindi)\n",
"Magyar (Hungarian)\n",
"Bahasa Indonesia (Indonesian)\n",
"Italiano (Italian)\n",
"עברית (Hebrew)\n",
"日本語 (Japanese)\n",
"한국어 (Korean)\n",
"मर (Marathi)\n",
"Bahasa Malaysia (Malay)\n",
"Nederlands (Dutch)\n",
"Norsk (Norwegian)\n",
"ਪ (Punjabi)\n",
"Polski (Polish)\n",
"Português (Portuguese)\n",
"Română (Romanian)\n",
"Русский (Russian)\n",
"Svenska (Swedish)\n",
"త (Telugu)\n",
"ภาษาไทย (Thai)\n",
"Tagalog (Tagalog)\n",
"Türkçe (Turkish)\n",
"Українська (Ukrainian)\n",
"Tiếng Việt (Vietnamese)\n",
"简体中文 (Chinese (Simplified))\n",
"正體中文 (Chinese (Traditional))\n",
"Language\n",
"Agree & Join LinkedIn\n",
"By clicking Continue to join or sign in, you agree to LinkedIn’s\n",
"User Agreement\n",
",\n",
"Privacy Policy\n",
", and\n",
"Cookie Policy\n",
".\n",
"Sign in to see who you already know at Hugging Face\n",
"Sign in\n",
"Welcome back\n",
"Email or phone\n",
"Password\n",
"Show\n",
"Forgot password?\n",
"Sign in\n",
"or\n",
"By clicking Continue to join or sign in, you agree to LinkedIn’s\n",
"User Agreement\n",
",\n",
"Privacy Policy\n",
", and\n",
"Cookie Policy\n",
".\n",
"New to LinkedIn?\n",
"Join now\n",
"or\n",
"New to LinkedIn?\n",
"Join now\n",
"By clicking Continue to join or sign in, you agree to LinkedIn’s\n",
"User Agreement\n",
",\n",
"Privacy Policy\n",
", and\n",
"Cookie Policy\n",
".\n",
"LinkedIn\n",
"LinkedIn is better on the app\n",
"Don’t have the app? Get it in the Microsoft Store.\n",
"Open the app\n",
"\n",
"\n",
"\n",
"Twitter page\n",
"Webpage Title:\n",
"x.com\n",
"Webpage Contents:\n",
"\n",
"\n",
"\n"
]
}
],
"source": [
"print(get_all_details(\"https://huggingface.co\"))"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "9b863a55-f86c-4e3f-8a79-94e24c1a8cf2",
"metadata": {},
"outputs": [],
"source": [
"# system_prompt = \"You are an assistant that analyzes the contents of several relevant pages from a company website \\\n",
"# and creates a short brochure about the company for prospective customers, investors and recruits. Respond in markdown.\\\n",
"# Include details of company culture, customers and careers/jobs if you have the information.\"\n",
"\n",
"# Or uncomment the lines below for a more humorous brochure - this demonstrates how easy it is to incorporate 'tone':\n",
"\n",
"system_prompt = \"\"\"\n",
"You are an assistant that analyzes the contents of several relevant pages from a company website\n",
"and creates a short humorous, entertaining brochure about the company for prospective and previous customers.\n",
"Include details of company culture and customers if you have the information. Focus on work to create or maintain pickle ball courts.\n",
"Write in a theme for Valentine's Day.\n",
"Emphasize customers that may need upkeep and maintenance of their existing property and installations.\n",
"Return results in Markdown. Limit response to 250 words.\n",
"\"\"\"\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "6ab83d92-d36b-4ce0-8bcc-5bb4c2f8ff23",
"metadata": {},
"outputs": [],
"source": [
"def get_brochure_user_prompt(company_name, url):\n",
" user_prompt = f\"You are looking at a company called: {company_name}\\n\"\n",
" user_prompt += f\"Here are the contents of its landing page and other relevant pages; use this information to build a short brochure of the company in markdown.\\n\"\n",
" user_prompt += get_all_details(url)\n",
" user_prompt = user_prompt[:5_000] # Truncate if more than 5,000 characters\n",
" return user_prompt"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "cd909e0b-1312-4ce2-a553-821e795d7572",
"metadata": {},
"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': 'documentation page', 'url': 'https://huggingface.co/docs'}, {'type': 'join page', 'url': 'https://huggingface.co/join'}, {'type': 'discussion forum', 'url': 'https://discuss.huggingface.co'}, {'type': 'twitter page', 'url': 'https://twitter.com/huggingface'}, {'type': 'linkedin page', '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\\nNEW\\nWelcome to Inference Providers on the Hub 🔥\\nsmolagents - a smol library to build great agents\\nUse models from the HF Hub in LM Studio\\nThe AI community building the future.\\nThe platform where the machine learning community collaborates on models, datasets, and applications.\\nTrending on\\nthis week\\nModels\\ndeepseek-ai/DeepSeek-R1\\nUpdated\\n2 days ago\\n•\\n845k\\n•\\n6.06k\\ndeepseek-ai/Janus-Pro-7B\\nUpdated\\n1 day ago\\n•\\n134k\\n•\\n2.4k\\ndeepseek-ai/DeepSeek-V3\\nUpdated\\n10 days ago\\n•\\n877k\\n•\\n3.02k\\nmistralai/Mistral-Small-24B-Instruct-2501\\nUpdated\\nabout 12 hours ago\\n•\\n12.1k\\n•\\n492\\nunsloth/DeepSeek-R1-GGUF\\nUpdated\\n3 days ago\\n•\\n262k\\n•\\n473\\nBrowse 400k+ models\\nSpaces\\nRunning\\non\\nZero\\n1.24k\\n🌍\\nChat With Janus-Pro-7B\\nA unified multimodal understanding and generation model.\\nRunning\\non\\nZero\\n1.16k\\n🌍\\nHunyuan3D-2.0\\nText-to-3D and Image-to-3D Generation\\nRunning\\non\\nZero\\n2.37k\\n📈\\nIC Light V2\\nRunning\\n330\\n🐢\\nQwen2.5 Max Demo\\nRunning\\n274\\n🚂\\nNeuralJam\\nEscapeExpress : LLM AI detective puzzle game.\\nBrowse 150k+ applications\\nDatasets\\nopen-thoughts/OpenThoughts-114k\\nUpdated\\n5 days ago\\n•\\n11.4k\\n•\\n195\\nfka/awesome-chatgpt-prompts\\nUpdated\\n28 days ago\\n•\\n8.91k\\n•\\n7.28k\\ncognitivecomputations/dolphin-r1\\nUpdated\\n3 days ago\\n•\\n436\\n•\\n142\\nServiceNow-AI/R1-Distill-SFT\\nUpdated\\n5 days ago\\n•\\n1.16k\\n•\\n121\\nbespokelabs/Bespoke-Stratos-17k\\nUpdated\\n3 days ago\\n•\\n21.3k\\n•\\n178\\nBrowse 100k+ 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•\\n381 models\\n•\\n2.08k followers\\nAI at Meta\\nEnterprise\\ncompany\\n•\\n2.06k models\\n•\\n4.36k followers\\nAmazon Web Services\\ncompany\\n•\\n20 models\\n•\\n2.64k followers\\nGoogle\\ncompany\\n•\\n913 models\\n•\\n7.14k followers\\nIntel\\ncompany\\n•\\n218 models\\n•\\n2.2k followers\\nMicrosoft\\ncompany\\n•\\n354 models\\n•\\n7.99k followers\\nGrammarly\\ncompany\\n•\\n10 models\\n•\\n120 followers\\nWriter\\nEnterprise\\ncompany\\n•\\n19 models\\n•\\n203 followers\\nOur Open Source\\nWe are building the foundation of ML tooling with the community.\\nTransformers\\n138,457\\nState-of-the-art ML for Pytorch, TensorFlow, and JAX.\\nDiffusers\\n27,351\\nState-of-the-art diffusion models for image and audio generation in PyTorch.\\nSafetensors\\n3,049\\nSimple, safe way to store and distribute neural networks weights safely and quickly.\\nHub Python Library\\n2,288\\nClient library for the HF Hub: manage repositories from your Python runtime.\\nTokenizers\\n9,320\\nFast tokenizers, optimized for both research and production.\\nPEFT\\n17,127\\nParameter efficient finetuning methods for large models.\\nTransformers.js\\n12,786\\nState-of-the-art Machine Learning for the web. Run Transformers directly in your browser, with no need for a server.\\ntimm\\n33,042\\nState-of-the-art computer vision models, layers, optimizers, training/evaluation, and utilities.\\nTRL\\n10,982\\nTrain transformer language models with reinforcement learning.\\nDatasets\\n19,535\\nAccess and share datasets for computer vision, audio, and NLP tasks.\\nText Generation Inference\\n9,685\\nToolkit to serve Large Language Models.\\nAccelerate\\n8,253\\nEasily train and use 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:\\nhuggingface (Hugging Face)\\nWebpage Contents:\\nHugging Face\\nModels\\nDatasets\\nSpaces\\nPosts\\nDocs\\nEnterprise\\nPricing\\nLog In\\nSign Up\\nHugging Face\\nEnterprise\\ncompany\\nVerified\\nhttps://huggingface.co\\nhuggingface\\nhuggingface\\nActivity Feed\\nFollow\\n16,542\\nAI & ML interests\\nThe AI community building the future.\\nRecent Activity\\nnielsr\\nupdated\\na dataset\\n34 minutes ago\\nhuggingface/community-science-merged\\nm-ric\\nupdated\\na dataset\\n2 days ago\\nhuggingface/documentation-images\\npcuenq\\nnew\\nactivity\\n2 days ago\\nhuggingface/Huggi'"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"get_brochure_user_prompt(\"HuggingFace\", \"https://huggingface.co\")"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "e44de579-4a1a-4e6a-a510-20ea3e4b8d46",
"metadata": {},
"outputs": [],
"source": [
"def create_brochure(company_name, url):\n",
" response = openai.chat.completions.create(\n",
" model=MODEL,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n",
" ],\n",
" )\n",
" result = response.choices[0].message.content\n",
" display(Markdown(result))"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "e093444a-9407-42ae-924a-145730591a39",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found links: {'links': [{'type': 'about page', 'url': 'https://saviano.com/about/'}, {'type': 'services page', 'url': 'https://saviano.com/services/'}, {'type': 'contact page', 'url': 'https://saviano.com/contact/'}, {'type': 'request a quote page', 'url': 'https://saviano.com/request-a-quote/'}]}\n"
]
},
{
"data": {
"text/markdown": [
"```markdown\n",
"# 💖 Fall in Love with Your Courts This Valentine’s Day! 💖\n",
"\n",
"Welcome to **Saviano Co. Inc.**, where our love for court construction is as timeless as your favorite romance! Since 1963, we've been crafting dreamy courts that make hearts skip a beat and tennis balls bounce gloriously. We're not just experts; we're your court construction soulmates! 💘\n",
"\n",
"## 🏗 Our Heartfelt Services\n",
"Whether you need to sweep your courts off their feet or give them a little Valentine’s Day makeover, our loveable range of services includes:\n",
"\n",
"- **Paving**: Like a smooth first date, we set the perfect foundation! \n",
"- **Grading & Excavation**: We dig deep to find and love every inch of your property.\n",
"- **Resurfacing**: Give your courts the glow-up they deserve. It's basically a spa day for your tennis surface! \n",
"- **Lighting**: Because love should shine bright, even at night.\n",
"- **Fencing**: Protect your court, just as you’d protect your heart.\n",
"- **Consulting**: Let's talk about your dreams over a virtual cup of cocoa. ☕\n",
"\n",
"And not to forget our **Athletic Surfaces**- perfect for Tennis, Pickleball, Basketball, and even Running Tracks! We cater to players who love to play until the sun sets. \n",
"\n",
"## 🌍 A Family Legacy \n",
"The Saviano family has served up love and loyalty for generations! With nine Wimbledon contenders in the family, we know how to keep your game strong and maintain high standards. We believe in relationships built on trust, just as John Saviano trusts his court-building passion. \n",
"\n",
"## 💌 Our Customers, Our Sweethearts\n",
"We love our customers, and they love us back! Our portfolio is filled with passionate players and property owners who want to maintain that little slice of court paradise you’ve got tucked away. Whether you run hotel chains or are a suburban homeowner needing a little TLC for your court, we’re here to turn that love for the game into something beautiful.\n",
"\n",
"### So, you're feeling a little *maintenance on your heart*? 💔\n",
"No worries! We specialize in **upkeep and maintenance**. With us, your surfaces will be so smooth you'll think they're wearing Cupid’s wings. \n",
"\n",
"## 💼 Join Our Love Parade! \n",
"Looking for a career that makes you feel like you could serve an ace every day? **Saviano Co. Inc.** is hiring! Become part of our family, and let’s create something beautiful together. Because love isn’t just a feeling – it’s a career choice!\n",
"\n",
"### Contact Us\n",
"Ready to explore your court’s potential with **Saviano Co. Inc.**? Give us a call at **(800) 81-TENNIS** or email us at **info@saviano.com** for a chat that might lead to love! \n",
"\n",
"### Celebrate Love!\n",
"This Valentine's Day, choose us - your trusted partner in court construction and maintenance. Because great courts deserve wonderful care! 💞\n",
"\n",
"---\n",
"*Saviano Co. Inc. – Where Passion Meets Court Construction!*\n",
"```\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"create_brochure(\"Saviano, Inc.\", \"https://saviano.com\")"
]
},
{
"cell_type": "markdown",
"id": "61eaaab7-0b47-4b29-82d4-75d474ad8d18",
"metadata": {},
"source": [
"## Finally - a minor improvement\n",
"\n",
"With a small adjustment, we can change this so that the results stream back from OpenAI,\n",
"with the familiar typewriter animation"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "51db0e49-f261-4137-aabe-92dd601f7725",
"metadata": {},
"outputs": [],
"source": [
"def stream_brochure(company_name, url):\n",
" stream = openai.chat.completions.create(\n",
" model=MODEL,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n",
" ],\n",
" stream=True,\n",
" temperature=0.2\n",
" )\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",
" update_display(Markdown(response), display_id=display_handle.display_id)"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "56bf0ae3-ee9d-4a72-9cd6-edcac67ceb6d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found links: {'links': [{'type': 'about page', 'url': 'https://saviano.com/about/'}, {'type': 'services page', 'url': 'https://saviano.com/services/'}, {'type': 'contact page', 'url': 'https://saviano.com/contact/'}, {'type': 'blog page', 'url': 'https://saviano.com/blog/'}, {'type': 'reviews page', 'url': 'https://saviano.com/reviews/'}, {'type': 'consulting page', 'url': 'https://saviano.com/home/consulting/'}]}\n"
]
},
{
"data": {
"text/markdown": [
"\n",
"# 💖 Love at First Serve: Saviano Co. Inc. 💖\n",
"\n",
"**Roses are red, \n",
"Pickleballs are green, \n",
"Saviano builds courts, \n",
"Where love can be seen!**\n",
"\n",
"At Saviano Co. Inc., we’ve been serving up love since 1963! With a family legacy that’s as strong as your backhand, we specialize in constructing and maintaining pickleball courts that will make your heart skip a beat. Whether you’re looking to build a new court or give your existing one a little TLC, we’ve got the expertise to keep your game—and your love life—on point!\n",
"\n",
"### Why Choose Us?\n",
"- **Expertise That’s Love-ly**: With decades of experience, our team knows how to create the perfect playing surface for your romantic rallies.\n",
"- **Maintenance with Heart**: Is your court looking a little worse for wear? Let us sprinkle some magic dust (and a bit of resurfacing) to keep the love alive!\n",
"- **Family Values**: Just like a good relationship, we believe in trust, quality, and a whole lot of fun. \n",
"\n",
"### Our Services:\n",
"- **Paving & Grading**: Lay the foundation for love!\n",
"- **Resurfacing**: Because every court deserves a makeover.\n",
"- **Lighting & Fencing**: Keep the sparks flying, day or night!\n",
"\n",
"So, whether you’re a couple looking to rekindle your passion for pickleball or a facility needing a little maintenance love, Saviano Co. Inc. is here to serve! \n",
"\n",
"**Contact us today and let’s make your court the place where love blossoms!** \n",
"📞 (800) 81-TENNIS \n",
"🌐 [saviano.com](http://saviano.com)\n",
"\n",
"**Happy Valentine’s Day!**\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"stream_brochure(\"Saviano, Inc.\", \"https://saviano.com\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fdb3f8d8-a3eb-41c8-b1aa-9f60686a653b",
"metadata": {},
"outputs": [],
"source": [
"# Try changing the system prompt to the humorous version when you make the Brochure for Hugging Face:\n",
"\n",
"stream_brochure(\"HuggingFace\", \"https://huggingface.co\")"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "be8425a3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Note: you may need to restart the kernel to use updated packages.\n",
"Note: you may need to restart the kernel to use updated packages.\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"#\n",
"# # Full code\n",
"#\n",
"\n",
"# imports\n",
"# If these fail, please check you're running from an 'activated' environment with (llms) in the command prompt\n",
"\n",
"%pip install -q bs4\n",
"%pip install -q -U google-generativeai\n",
"%pip install -q ollama\n",
"\n",
"import os\n",
"import requests\n",
"import json\n",
"from dotenv import load_dotenv\n",
"from bs4 import BeautifulSoup\n",
"from IPython.display import Markdown, display, update_display\n",
"from openai import OpenAI\n",
"import google.generativeai as genai\n",
"import ollama\n",
"import gradio as gr\n",
"\n",
"llm2use = 'googleai'\n",
"\n",
"match llm2use:\n",
" case 'openai':\n",
" MODEL = 'gpt-4o-mini'\n",
" case 'googleai':\n",
" MODEL = 'gemini-1.5-pro'\n",
" case 'ollama':\n",
" MODEL = 'llama3.2'\n",
" # Let's just make sure the model is loaded\n",
" !ollama pull llama3.2\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "8ee60429",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OpenAI API Key exists and begins sk-proj-\n",
"Google API Key exists and begins AIzaSyDi\n"
]
}
],
"source": [
"# Load environment variables in a file called .env\n",
"# Print the key prefixes to help with any debugging\n",
"\n",
"load_dotenv()\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 not set\")\n",
" \n",
"#if anthropic_api_key:\n",
"# print(f\"Anthropic API Key exists and begins {anthropic_api_key[:7]}\")\n",
"#else:\n",
"# print(\"Anthropic API Key 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 not set\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "e71bcc72",
"metadata": {},
"outputs": [],
"source": [
"# Connect to OpenAI, Anthropic and Google; comment out the Claude or Google lines if you're not using them\n",
"\n",
"openai = OpenAI()\n",
"#claude = anthropic.Anthropic()\n",
"genai.configure(api_key=google_api_key)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "ed40e585",
"metadata": {},
"outputs": [],
"source": [
"# A class to represent a Webpage\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",
" A utility class to represent a Website that we have scraped, now with links\n",
" \"\"\"\n",
"\n",
" def __init__(self, url):\n",
" self.url = url\n",
" response = requests.get(url, headers=headers)\n",
" self.body = response.content\n",
" soup = BeautifulSoup(self.body, 'html.parser')\n",
" self.title = soup.title.string if soup.title else \"No title found\"\n",
" if soup.body:\n",
" for irrelevant in soup.body([\"script\", \"style\", \"img\", \"input\"]):\n",
" irrelevant.decompose()\n",
" self.text = soup.body.get_text(separator=\"\\n\", strip=True)\n",
" else:\n",
" self.text = \"\"\n",
" links = [link.get('href') for link in soup.find_all('a')]\n",
" self.links = [link for link in links if link]\n",
"\n",
" def get_contents(self):\n",
" return f\"Webpage Title:\\n{self.title}\\nWebpage Contents:\\n{self.text}\\n\\n\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "dee23e0f",
"metadata": {},
"outputs": [],
"source": [
"link_system_prompt = \"You are provided with a list of links found on a webpage. \\\n",
"You are able to decide which of the links would be most relevant to include in a brochure about the company.\\n\"\n",
"link_system_prompt += \"You should respond in JSON as in this example:\"\n",
"link_system_prompt += \"\"\"\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",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "61957dad",
"metadata": {},
"outputs": [],
"source": [
"def get_links_user_prompt(website):\n",
" user_prompt = f\"Here is the list of links on the website of {website.url} - \"\n",
" user_prompt += \"please decide which of these are relevant web links for a brochure about the company, respond with the full https URL in JSON format. \\\n",
"Do not include Terms of Service, Privacy, email links.\\n\"\n",
" user_prompt += \"Links (some might be relative links):\\n\"\n",
" user_prompt += \"\\n\".join(website.links)\n",
" return user_prompt"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "6d79189b",
"metadata": {},
"outputs": [],
"source": [
"def get_links(url):\n",
" website = Website(url)\n",
" \n",
" match llm2use:\n",
" case 'openai':\n",
" response = openai.chat.completions.create(\n",
" model=MODEL,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": link_system_prompt},\n",
" {\"role\": \"user\", \"content\": get_links_user_prompt(website)}\n",
" ],\n",
" response_format={\"type\": \"json_object\"}\n",
" )\n",
" result = response.choices[0].message.content\n",
" case 'ollama':\n",
" response = ollama.chat(\n",
" model=MODEL,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": link_system_prompt},\n",
" {\"role\": \"user\", \"content\": get_links_user_prompt(website)}\n",
" ]\n",
" )\n",
" result = response['message']['content']\n",
" case 'googleai':\n",
" model=genai.GenerativeModel(\n",
" model_name=MODEL,\n",
" system_instruction=link_system_prompt)\n",
" response = model.generate_content(\n",
" get_links_user_prompt(website),\n",
" generation_config=genai.GenerationConfig(\n",
" response_mime_type=\"application/json\"\n",
" ),\n",
" )\n",
" result = response.text\n",
"\n",
" return json.loads(result)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "a464417b",
"metadata": {},
"outputs": [],
"source": [
"# get_links(\"https://saviano.com\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "ab726584",
"metadata": {},
"outputs": [],
"source": [
"def get_all_details(url):\n",
" result = \"Landing page:\\n\"\n",
" result += Website(url).get_contents()\n",
" links = get_links(url)\n",
" #print(\"Found links:\", links)\n",
" for link in links[\"links\"]:\n",
" result += f\"\\n\\n{link['type']}\\n\"\n",
" result += Website(link[\"url\"]).get_contents()\n",
" return result"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "05ec7b06",
"metadata": {},
"outputs": [],
"source": [
"# get_all_details(\"https://saviano.com\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "152f2ca4",
"metadata": {},
"outputs": [],
"source": [
"# system_prompt = \"You are an assistant that analyzes the contents of several relevant pages from a company website \\\n",
"# and creates a short brochure about the company for prospective customers, investors and recruits. Respond in markdown.\\\n",
"# Include details of company culture, customers and careers/jobs if you have the information.\"\n",
"\n",
"# Or uncomment the lines below for a more humorous brochure - this demonstrates how easy it is to incorporate 'tone':\n",
"\n",
"system_prompt = \"\"\"\n",
"You are an assistant that analyzes the contents of several relevant pages from a company website\n",
"and creates a short humorous, entertaining brochure about the company for prospective and previous customers.\n",
"Include details of company culture and customers if you have the information. Focus on work to create or maintain pickle ball courts.\n",
"Write in a theme for Valentine's Day.\n",
"Emphasize customers that may need upkeep and maintenance of their existing property and installations.\n",
"Return results in Markdown.\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "7f1dee2b",
"metadata": {},
"outputs": [],
"source": [
"def get_brochure_user_prompt(company_name, url):\n",
" user_prompt = f\"You are looking at a company called: {company_name}\\n\"\n",
" user_prompt += f\"Here are the contents of its landing page and other relevant pages; use this information to build a short brochure of the company in markdown.\\n\"\n",
" user_prompt += get_all_details(url)\n",
" user_prompt = user_prompt[:5_000] # Truncate if more than 5,000 characters\n",
" return user_prompt"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "7a0d6513",
"metadata": {},
"outputs": [],
"source": [
"def create_brochure(company_name, url):\n",
" temperature = 0.2\n",
" print(\"Using %s LLM with model %s and temperature %.2f\" % (llm2use,MODEL,temperature))\n",
"\n",
" match llm2use:\n",
" case 'openai':\n",
" response = openai.chat.completions.create(\n",
" model=MODEL,\n",
" temperature=temperature,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n",
" ],\n",
" )\n",
" result = response.choices[0].message.content\n",
" case 'ollama':\n",
" response = ollama.chat(\n",
" model=MODEL,\n",
" options = {\n",
" #'temperature': 1.5, # very creative\n",
" 'temperature': temperature\n",
" }, \n",
" messages=[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n",
" ]\n",
" )\n",
" result = response['message']['content']\n",
" case 'googleai':\n",
" model=genai.GenerativeModel(\n",
" model_name=MODEL,\n",
" system_instruction=system_prompt)\n",
" response = model.generate_content(\n",
" get_brochure_user_prompt(company_name, url),\n",
" generation_config = genai.GenerationConfig(\n",
" temperature=temperature\n",
" )\n",
" )\n",
" result = response.text\n",
"\n",
" display(Markdown(result))"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "cad4be6c",
"metadata": {},
"outputs": [],
"source": [
"# create_brochure(\"Saviano, Inc.\", \"https://saviano.com\")"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "9815826c",
"metadata": {},
"outputs": [],
"source": [
"#\n",
"# # Everything below here uses values from the gradio web interface. Not the static values defined above\n",
"#\n",
"def stream_openai(system_prompt,company_name,url,model,temperature):\n",
"\n",
" response = openai.chat.completions.create(\n",
" model=model,\n",
" stream=True,\n",
" temperature=temperature,\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n",
" ],\n",
" )\n",
"\n",
" result = \"\"\n",
" for chunk in response:\n",
" result += chunk.choices[0].delta.content or \"\"\n",
" yield result\n",
"\n",
" print(result)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "f3d7b1f8",
"metadata": {},
"outputs": [],
"source": [
"def stream_googleai(system_prompt,company_name,url,model,temperature):\n",
"\n",
" model=genai.GenerativeModel(\n",
" model_name=model,\n",
" system_instruction=system_prompt)\n",
" responses = model.generate_content(\n",
" get_brochure_user_prompt(company_name, url),\n",
" generation_config = genai.GenerationConfig(\n",
" temperature=temperature\n",
" ),\n",
" stream=True\n",
" )\n",
"\n",
" result = \"\"\n",
" for response in responses:\n",
" result += response.text\n",
" yield result\n",
"\n",
" print(result)\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "7101239a",
"metadata": {},
"outputs": [],
"source": [
"def stream_ollama(system_prompt,company_name,url,model,temperature):\n",
"\n",
" response = ollama.chat(\n",
" stream=True,\n",
" model=model,\n",
" options = {\n",
" #'temperature': 1.5, # very creative\n",
" 'temperature': temperature\n",
" }, \n",
" messages=[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": get_brochure_user_prompt(company_name, url)}\n",
" ]\n",
" )\n",
"\n",
" # Printing out each piece of the generated response while preserving order\n",
" result = \"\"\n",
" for chunk in response:\n",
" result += chunk['message']['content']\n",
" yield result\n",
"\n",
" print(result)\n"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "84f5cb7a",
"metadata": {},
"outputs": [],
"source": [
"def stream_model(system_prompt,company_name,url,llm_model,temperature):\n",
"\n",
" print(\"Analyzing %s from %s\" % (company_name,url))\n",
"\n",
" match llm_model:\n",
" case 'openai_gpt-4o-mini':\n",
" model = \"gpt-4o-mini\"\n",
" print(\"\\n*** Using LLM %s and model %s\\n\" % (\"openai\",model))\n",
" result = stream_openai(system_prompt,company_name,url,model,temperature)\n",
" case 'googleai_gemini-1.5-pro':\n",
" model = \"gemini-1.5-pro\"\n",
" print(\"\\n***Using LLM %s and model %s\\n\" % (\"googleai\",model))\n",
" result = stream_googleai(system_prompt,company_name,url,model,temperature)\n",
" case 'googleai_gemini-1.5-flash':\n",
" model = \"gemini-1.5-flash\"\n",
" print(\"\\n***Using LLM %s and model %s\\n\" % (\"googleai\",model))\n",
" result = stream_googleai(system_prompt,company_name,url,model,temperature)\n",
" case 'ollama_llama3.2':\n",
" model = \"llama3.2\"\n",
" print(\"\\n***Using LLM %s and model %s\\n\" % (\"ollama\",model))\n",
" result = stream_ollama(system_prompt,company_name,url,model,temperature)\n",
" case _:\n",
" raise ValueError(\"Unknown LLM and MODEL combination\")\n",
" \n",
" \n",
" yield from result"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "89198e7b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Running on local URL: http://127.0.0.1:7860\n",
"* Running on public URL: https://db5c1425d7fa6f8b83.gradio.live\n",
"\n",
"This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)\n"
]
},
{
"data": {
"text/html": [
"<div><iframe src=\"https://db5c1425d7fa6f8b83.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": []
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Analyzing Saviano, Co. from https://saviano.com\n",
"\n",
"***Using LLM ollama and model llama3.2\n",
"\n",
"**Love is in the Air... and on the Court!**\n",
"==============================\n",
"\n",
"Welcome to Saviano Co. Inc., your premier partner for pickleball court construction, maintenance, and everything in between!\n",
"\n",
"**A Family Legacy of Excellence**\n",
"---------------------------------\n",
"\n",
"At Saviano Co. Inc., we're not just a company - we're a family with a passion for tennis and a commitment to excellence. Since 1963, we've been building top-tier athletic courts for pickleball, tennis, basketball, and more.\n",
"\n",
"**Why Choose Us?**\n",
"------------------\n",
"\n",
"* **Expert Craftsmanship**: Our team of professionals delivers exceptional construction services with speed, precision, and care.\n",
"* **Fair Pricing**: We believe in delivering value without compromising on quality.\n",
"* **Guaranteed Satisfaction**: Our customers love what we do, and we're confident you will too!\n",
"\n",
"**Our Customers Say It Best**\n",
"------------------------------\n",
"\n",
"* \"Saviano Co. Inc. is the go-to partner for all our court construction needs. Their expertise, professionalism, and passion for tennis are unmatched!\" - [Renowned Country Club]\n",
"* \"We've worked with Saviano Co. Inc. for years, and their commitment to excellence has been unwavering. We can't recommend them enough!\" - [Prestigious University]\n",
"\n",
"**Special Offer for Valentine's Day**\n",
"------------------------------------\n",
"\n",
"Show your love for pickleball (and tennis!) by requesting a free quote from us today! Our team will work with you to create an unforgettable court experience that will be the envy of all your friends and family.\n",
"\n",
"**Get in Touch**\n",
"----------------\n",
"\n",
"Phone: (650) 948-3274\n",
"Email: [info@saviano.com](mailto:info@saviano.com)\n",
"Website: [www.saviannonc.com](http://www.saviannonc.com)\n",
"\n",
"**Join the Love!**\n",
"-----------------\n",
"\n",
"Saviano Co. Inc. is more than just a company - we're your partners in creating unforgettable court experiences that will bring people together and create lifelong memories. Contact us today to get started!\n",
"\n",
"[Image: A happy couple playing pickleball on a beautiful court, with a sunset in the background]\n",
"\n",
"Happy Valentine's Day from Saviano Co. Inc.!\n"
]
}
],
"source": [
"view = gr.Interface(\n",
" fn=stream_model,\n",
" inputs=[\n",
" gr.Textbox(label=\"AI Agent\",value=system_prompt),\n",
" gr.Textbox(label=\"Company Name\", value=\"Saviano, Co.\"),\n",
" gr.Textbox(label=\"Website to analyze\", value=\"https://saviano.com\"),\n",
" gr.Dropdown([\"openai_gpt-4o-mini\", \"googleai_gemini-1.5-pro\", \"googleai_gemini-1.5-flash\",\"ollama_llama3.2\"], label=\"Select AI Engine and LLM Model\", value=\"ollama_llama3.2\"),\n",
" gr.Slider(0,2,value=0.7,label=\"AI Temperature\",info=\"AI Creativity Level (higher = more creative)\")\n",
" ],\n",
" outputs=[\n",
" gr.Markdown(label=\"Response:\")\n",
" ],\n",
" flagging_mode=\"never\"\n",
")\n",
"view.launch(share=True)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "10582920",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Note: you may need to restart the kernel to use updated packages.\n"
]
},
{
"ename": "ValueError",
"evalue": "Provided path: 'week1' is not a file on the local file system",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[31], line 14\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;66;03m#create_repo(name=target_space_name, token=hf_token, repo_type=\"space\", space_sdk=\"gradio\")\u001b[39;00m\n\u001b[1;32m 13\u001b[0m repo_name \u001b[38;5;241m=\u001b[39m get_full_repo_name(model_id\u001b[38;5;241m=\u001b[39mtarget_space_name, token\u001b[38;5;241m=\u001b[39mhf_token)\n\u001b[0;32m---> 14\u001b[0m file_url \u001b[38;5;241m=\u001b[39m \u001b[43mupload_file\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 15\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath_or_fileobj\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpath_to_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 16\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath_in_repo\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mapp.py\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 17\u001b[0m \u001b[43m \u001b[49m\u001b[43mrepo_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrepo_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 18\u001b[0m \u001b[43m \u001b[49m\u001b[43mrepo_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mspace\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 19\u001b[0m \u001b[43m \u001b[49m\u001b[43mtoken\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mhf_token\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 20\u001b[0m \u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Documents/devwork/andersondang/llm_engineering/llms/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py:114\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m check_use_auth_token:\n\u001b[1;32m 112\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[38;5;241m=\u001b[39mfn\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m, has_token\u001b[38;5;241m=\u001b[39mhas_token, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[0;32m--> 114\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Documents/devwork/andersondang/llm_engineering/llms/lib/python3.11/site-packages/huggingface_hub/hf_api.py:1524\u001b[0m, in \u001b[0;36mfuture_compatible.<locals>._inner\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1521\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrun_as_future(fn, \u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 1523\u001b[0m \u001b[38;5;66;03m# Otherwise, call the function normally\u001b[39;00m\n\u001b[0;32m-> 1524\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Documents/devwork/andersondang/llm_engineering/llms/lib/python3.11/site-packages/huggingface_hub/hf_api.py:4400\u001b[0m, in \u001b[0;36mHfApi.upload_file\u001b[0;34m(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit, run_as_future)\u001b[0m\n\u001b[1;32m 4395\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInvalid repo type, must be one of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mconstants\u001b[38;5;241m.\u001b[39mREPO_TYPES\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 4397\u001b[0m commit_message \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 4398\u001b[0m commit_message \u001b[38;5;28;01mif\u001b[39;00m commit_message \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUpload \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mpath_in_repo\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m with huggingface_hub\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 4399\u001b[0m )\n\u001b[0;32m-> 4400\u001b[0m operation \u001b[38;5;241m=\u001b[39m \u001b[43mCommitOperationAdd\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 4401\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath_or_fileobj\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpath_or_fileobj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 4402\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath_in_repo\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpath_in_repo\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 4403\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4405\u001b[0m commit_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcreate_commit(\n\u001b[1;32m 4406\u001b[0m repo_id\u001b[38;5;241m=\u001b[39mrepo_id,\n\u001b[1;32m 4407\u001b[0m repo_type\u001b[38;5;241m=\u001b[39mrepo_type,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 4414\u001b[0m parent_commit\u001b[38;5;241m=\u001b[39mparent_commit,\n\u001b[1;32m 4415\u001b[0m )\n\u001b[1;32m 4417\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m commit_info\u001b[38;5;241m.\u001b[39mpr_url \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
"File \u001b[0;32m<string>:5\u001b[0m, in \u001b[0;36m__init__\u001b[0;34m(self, path_in_repo, path_or_fileobj)\u001b[0m\n",
"File \u001b[0;32m~/Documents/devwork/andersondang/llm_engineering/llms/lib/python3.11/site-packages/huggingface_hub/_commit_api.py:176\u001b[0m, in \u001b[0;36mCommitOperationAdd.__post_init__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 174\u001b[0m path_or_fileobj \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mnormpath(os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mexpanduser(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpath_or_fileobj))\n\u001b[1;32m 175\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39misfile(path_or_fileobj):\n\u001b[0;32m--> 176\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mProvided path: \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mpath_or_fileobj\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m is not a file on the local file system\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 177\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpath_or_fileobj, (io\u001b[38;5;241m.\u001b[39mBufferedIOBase, \u001b[38;5;28mbytes\u001b[39m)):\n\u001b[1;32m 178\u001b[0m \u001b[38;5;66;03m# ^^ Inspired from: https://stackoverflow.com/questions/44584829/how-to-determine-if-file-is-opened-in-binary-or-text-mode\u001b[39;00m\n\u001b[1;32m 179\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 180\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpath_or_fileobj must be either an instance of str, bytes or\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 181\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m io.BufferedIOBase. If you passed a file-like object, make sure it is\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 182\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m in binary mode.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 183\u001b[0m )\n",
"\u001b[0;31mValueError\u001b[0m: Provided path: 'week1' is not a file on the local file system"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Analyzing Saviano, Co. from https://saviano.com\n",
"\n",
"***Using LLM ollama and model llama3.2\n",
"\n",
"**Love is in the Air... and on the Court!**\n",
"\n",
"Welcome to Saviano Co. Inc., the ultimate partner for all your court construction needs. As we celebrate Valentine's Day, we're reminded of the importance of love, care, and attention to detail - qualities that our team embodies in every project we undertake.\n",
"\n",
"**A Family Affair**\n",
"\n",
"At Saviano Co. Inc., we're a family company with a legacy that spans over 60 years. Our passion for tennis and commitment to excellence have been passed down through generations, ensuring that every project is crafted with precision and care.\n",
"\n",
"**Pickleball Perfection**\n",
"\n",
"We specialize in top-tier athletic courts for pickleball, tennis, basketball, and more. Our expert craftsmanship, fair pricing, and guaranteed satisfaction ensure that your court is a haven for players of all levels. Whether you're looking to improve your game or create unforgettable tennis experiences, our team is here to help.\n",
"\n",
"**But We Don't Just Build Courts...**\n",
"\n",
"We also offer a range of services, including paving, grading, excavation, resurfacing, lighting, drainage, fencing, consulting, and more. Our team works tirelessly to ensure that every detail is handled efficiently and professionally.\n",
"\n",
"**What Our Customers Say**\n",
"\n",
"Don't just take our word for it! Our customers rave about our exceptional service, speed, precision, and attention to detail. From renowned country clubs to prestigious universities, we've built a reputation that speaks for itself.\n",
"\n",
"**Join the Love**\n",
"\n",
"At Saviano Co. Inc., we're dedicated to elevating your game and your courts. Join the countless enthusiasts who trust us to deliver top-notch service and unparalleled expertise in court construction.\n",
"\n",
"Contact us today to request a free quote and experience the power of love, care, and attention to detail in every project we undertake.\n",
"\n",
"**Call Us: (650) 948-3274**\n",
"**Email Us: info@saviano.com**\n",
"**Visit Our Website: [www.saviano.com](http://www.saviano.com)**\n",
"\n",
"Happy Valentine's Day from the Saviano Co. Inc. team!\n"
]
}
],
"source": [
"%pip install -q huggingface_hub\n",
"\n",
"hf_token = 'REPLACE_WITH_ACTUAL_TOKEN'\n",
"target_space_name = 'create-brochure'\n",
"path_to_file = 'week1'\n",
"\n",
"from huggingface_hub import (\n",
" create_repo,\n",
" get_full_repo_name,\n",
" upload_file,\n",
")\n",
"#create_repo(name=target_space_name, token=hf_token, repo_type=\"space\", space_sdk=\"gradio\")\n",
"repo_name = get_full_repo_name(model_id=target_space_name, token=hf_token)\n",
"file_url = upload_file(\n",
" path_or_fileobj=path_to_file,\n",
" path_in_repo=\"app.py\",\n",
" repo_id=repo_name,\n",
" repo_type=\"space\",\n",
" token=hf_token,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "a27bf9e0-665f-4645-b66b-9725e2a959b5",
"metadata": {},
"source": [
"<table style=\"margin: 0; text-align: left;\">\n",
" <tr>\n",
" <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
" <img src=\"../business.jpg\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
" </td>\n",
" <td>\n",
" <h2 style=\"color:#181;\">Business applications</h2>\n",
" <span style=\"color:#181;\">In this exercise we extended the Day 1 code to make multiple LLM calls, and generate a document.\n",
"\n",
"This is perhaps the first example of Agentic AI design patterns, as we combined multiple calls to LLMs. This will feature more in Week 2, and then we will return to Agentic AI in a big way in Week 8 when we build a fully autonomous Agent solution.\n",
"\n",
"Generating content in this way is one of the very most common Use Cases. As with summarization, this can be applied to any business vertical. Write marketing content, generate a product tutorial from a spec, create personalized email content, and so much more. Explore how you can apply content generation to your business, and try making yourself a proof-of-concept prototype.</span>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "markdown",
"id": "14b2454b-8ef8-4b5c-b928-053a15e0d553",
"metadata": {},
"source": [
"<table style=\"margin: 0; text-align: left;\">\n",
" <tr>\n",
" <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
" <img src=\"../important.jpg\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
" </td>\n",
" <td>\n",
" <h2 style=\"color:#900;\">Before you move to Week 2 (which is tons of fun)</h2>\n",
" <span style=\"color:#900;\">Please see the week1 EXERCISE notebook for your challenge for the end of week 1. This will give you some essential practice working with Frontier APIs, and prepare you well for Week 2.</span>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "markdown",
"id": "17b64f0f-7d33-4493-985a-033d06e8db08",
"metadata": {},
"source": [
"<table style=\"margin: 0; text-align: left;\">\n",
" <tr>\n",
" <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
" <img src=\"../resources.jpg\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
" </td>\n",
" <td>\n",
" <h2 style=\"color:#f71;\">A reminder on 2 useful resources</h2>\n",
" <span style=\"color:#f71;\">1. The resources for the course are available <a href=\"https://edwarddonner.com/2024/11/13/llm-engineering-resources/\">here.</a><br/>\n",
" 2. I'm on LinkedIn <a href=\"https://www.linkedin.com/in/eddonner/\">here</a> and I love connecting with people taking the course!\n",
" </span>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "markdown",
"id": "6f48e42e-fa7a-495f-a5d4-26bfc24d60b6",
"metadata": {},
"source": [
"<table style=\"margin: 0; text-align: left;\">\n",
" <tr>\n",
" <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
" <img src=\"../thankyou.jpg\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
" </td>\n",
" <td>\n",
" <h2 style=\"color:#090;\">Finally! I have a special request for you</h2>\n",
" <span style=\"color:#090;\">\n",
" My editor tells me that it makes a MASSIVE difference when students rate this course on Udemy - it's one of the main ways that Udemy decides whether to show it to others. If you're able to take a minute to rate this, I'd be so very grateful! And regardless - always please reach out to me at ed@edwarddonner.com if I can help at any point.\n",
" </span>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b8d3e1a1-ba54-4907-97c5-30f89a24775b",
"metadata": {},
"outputs": [],
"source": []
}
],
"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": 5
}