{ "cells": [ { "cell_type": "code", "execution_count": 9, "id": "7c544f15-74a0-4ef5-886a-cb62a756d7e5", "metadata": { "tags": [] }, "outputs": [ { "ename": "SyntaxError", "evalue": "invalid syntax (1681792056.py, line 2)", "output_type": "error", "traceback": [ "\u001b[0;36m File \u001b[0;32m\"/tmp/ipykernel_14850/1681792056.py\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m yum install aria2\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" ] } ], "source": [ "%cd /home/ec2-user/SageMaker\n", "yum install aria2" ] }, { "cell_type": "code", "execution_count": 10, "id": "d4caaebe-c5e7-422e-a1da-585166c6d67c", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "fatal: destination path 'text-generation-webui' already exists and is not an empty directory.\n", "[Errno 2] No such file or directory: '/content/text-generation-webui'\n", "/home/ec2-user/SageMaker\n", "\u001b[31mERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'\u001b[0m\u001b[31m\n", "\u001b[0m/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/bin/sh: aria2c: command not found\n", "/home/ec2-user/SageMaker/text-generation-webui\n", "Traceback (most recent call last):\n", " File \"server.py\", line 12, in \n", " import gradio as gr\n", "ModuleNotFoundError: No module named 'gradio'\n" ] } ], "source": [ "\n", "\n", "!git clone -b v1.8 https://github.com/camenduru/text-generation-webui\n", "%cd /content/text-generation-webui\n", "!pip install -r requirements.txt\n", "\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/resolve/main/model-00001-of-00003.safetensors -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o model-00001-of-00003.safetensors\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/resolve/main/model-00002-of-00003.safetensors -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o model-00002-of-00003.safetensors\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/resolve/main/model-00003-of-00003.safetensors -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o model-00003-of-00003.safetensors\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/raw/main/model.safetensors.index.json -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o model.safetensors.index.json\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/raw/main/special_tokens_map.json -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o special_tokens_map.json\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/resolve/main/tokenizer.model -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o tokenizer.model\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/raw/main/tokenizer_config.json -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o tokenizer_config.json\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/raw/main/config.json -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o config.json\n", "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/4bit/Llama-2-13b-chat-hf/raw/main/generation_config.json -d /content/text-generation-webui/models/Llama-2-13b-chat-hf -o generation_config.json\n", "\n", "%cd /home/ec2-user/SageMaker/text-generation-webui\n", "!python server.py --share --chat --load-in-8bit --model /content/text-generation-webui/models/Llama-2-13b-chat-hf" ] }, { "cell_type": "code", "execution_count": null, "id": "65156833-73d0-474c-86db-876024f37dc9", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "conda_mxnet_p38", "language": "python", "name": "conda_mxnet_p38" }, "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.8.16" } }, "nbformat": 4, "nbformat_minor": 5 }