{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "02785614-9268-41c8-85a5-d579490edbbf", "metadata": { "tags": [] }, "outputs": [], "source": [ "!pip install huggingface-hub -Uqq" ] }, { "cell_type": "code", "execution_count": 6, "id": "9e6bd7ee-16a3-4f5a-8857-8bbba83eb9e7", "metadata": { "tags": [] }, "outputs": [], "source": [ "from huggingface_hub import snapshot_download\n", "from pathlib import Path\n", "\n", "local_model_path = Path(\"./LLM_bloomz_model\")\n", "local_model_path.mkdir(exist_ok=True)\n", "model_name = \"bigscience/bloomz-7b1-mt\"\n", "commit_hash = \"13e9b1a39fe86c8024fe15667d063aa8a3e32460\"" ] }, { "cell_type": "code", "execution_count": 7, "id": "94e8abc5-a58e-40e2-b1e6-fbf48307c716", "metadata": { "tags": [] }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "99ac229433d34bf693511ca8c97d87dc", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Fetching 11 files: 0%| | 0/11 [00:00, ?it/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3811b21ac8b34604b8f084136cfbc1c4", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)a3e32460/config.json: 0%| | 0.00/747 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "587be9231bfb47749831f0ec73679a3f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)an-zay-iam33.24300.0: 0%| | 0.00/74.9k [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "98126fd21c6e4dd6b9b67009e50468e4", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading main_log.txt: 0%| | 0.00/22.3M [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bfb00c4a9a6e442b8a09c3c40db79b4d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading pytorch_model.bin: 0%| | 0.00/14.1G [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d0b562098c9e4ae5a2c1d30e557bd965", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)32460/.gitattributes: 0%| | 0.00/1.49k [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a38ba238a2474aa3bc8bcadb1b6436cf", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)n-zay-iam09.104164.0: 0%| | 0.00/756k [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d338ced9f29847a1afb7908469f48196", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)a8a3e32460/README.md: 0%| | 0.00/24.8k [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "510f639ef50a41db9542a6797057a819", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)an-zay-iam33.28878.0: 0%| | 0.00/2.60M [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f40f10f1197d454e867e03c05ba49713", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)okenizer_config.json: 0%| | 0.00/199 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a6aab2bd961e42548c3b7166a6a1430c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading (…)cial_tokens_map.json: 0%| | 0.00/85.0 [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d6c6e4f772cd4d88bb95056a95e9355c", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading tokenizer.json: 0%| | 0.00/14.5M [00:00, ?B/s]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'LLM_bloomz_model/models--bigscience--bloomz-7b1-mt/snapshots/13e9b1a39fe86c8024fe15667d063aa8a3e32460'" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "snapshot_download(repo_id=model_name, revision=commit_hash, cache_dir=local_model_path)" ] }, { "cell_type": "markdown", "id": "f116708c-f780-4624-a0df-836c8786abc3", "metadata": {}, "source": [ "s3://sagemaker-us-east-1-106839800180/LLM-RAG/workshop/model/" ] }, { "cell_type": "code", "execution_count": 8, "id": "e9431deb-6359-442d-847b-1563f8dd3854", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "