{"cells":[{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":56281,"status":"ok","timestamp":1699017193765,"user":{"displayName":"Lucas Ruiz","userId":"18227400269330035369"},"user_tz":-60},"id":"ne6y4KvsP-YK","outputId":"030da997-b35b-4656-ca61-c991c5bd1666"},"outputs":[{"name":"stdout","output_type":"stream","text":["Collecting git+https://github.com/huggingface/transformers@main\n"," Cloning https://github.com/huggingface/transformers (to revision main) to /tmp/pip-req-build-ijn9gxtf\n"," Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /tmp/pip-req-build-ijn9gxtf\n"," Resolved https://github.com/huggingface/transformers to commit 011b15c1c75a575fcaee5a50de02ff316881816a\n"," Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n"," Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n"," Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n","Collecting accelerate\n"," Downloading accelerate-0.24.1-py3-none-any.whl (261 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m261.4/261.4 kB\u001b[0m \u001b[31m3.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting gradio\n"," Downloading gradio-4.0.2-py3-none-any.whl (25.3 MB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m25.3/25.3 MB\u001b[0m \u001b[31m48.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: torch in /usr/local/lib/python3.10/dist-packages (2.1.0+cu118)\n","Requirement already satisfied: torchvision in /usr/local/lib/python3.10/dist-packages (0.16.0+cu118)\n","Collecting diffusers\n"," Downloading diffusers-0.21.4-py3-none-any.whl (1.5 MB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.5/1.5 MB\u001b[0m \u001b[31m59.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from accelerate) (1.23.5)\n","Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from accelerate) (23.2)\n","Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate) (5.9.5)\n","Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from accelerate) (6.0.1)\n","Collecting huggingface-hub (from accelerate)\n"," Downloading huggingface_hub-0.18.0-py3-none-any.whl (301 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m302.0/302.0 kB\u001b[0m \u001b[31m34.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting aiofiles<24.0,>=22.0 (from gradio)\n"," Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n","Requirement already satisfied: altair<6.0,>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (4.2.2)\n","Collecting fastapi (from gradio)\n"," Downloading fastapi-0.104.1-py3-none-any.whl (92 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.9/92.9 kB\u001b[0m \u001b[31m13.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting ffmpy (from gradio)\n"," Downloading ffmpy-0.3.1.tar.gz (5.5 kB)\n"," Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n","Collecting gradio-client==0.7.0 (from gradio)\n"," Downloading gradio_client-0.7.0-py3-none-any.whl (302 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m302.7/302.7 kB\u001b[0m \u001b[31m36.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting httpx (from gradio)\n"," Downloading httpx-0.25.0-py3-none-any.whl (75 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.7/75.7 kB\u001b[0m \u001b[31m9.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: importlib-resources<7.0,>=1.3 in /usr/local/lib/python3.10/dist-packages (from gradio) (6.1.0)\n","Requirement already satisfied: jinja2<4.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (3.1.2)\n","Requirement already satisfied: markupsafe~=2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (2.1.3)\n","Requirement already satisfied: matplotlib~=3.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (3.7.1)\n","Collecting orjson~=3.0 (from gradio)\n"," Downloading orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m18.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: pandas<3.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (1.5.3)\n","Requirement already satisfied: pillow<11.0,>=8.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (9.4.0)\n","Collecting pydantic>=2.0 (from gradio)\n"," Downloading pydantic-2.4.2-py3-none-any.whl (395 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m395.8/395.8 kB\u001b[0m \u001b[31m44.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting pydub (from gradio)\n"," Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n","Collecting python-multipart (from gradio)\n"," Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: requests~=2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (2.31.0)\n","Collecting semantic-version~=2.0 (from gradio)\n"," Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n","Collecting tomlkit==0.12.0 (from gradio)\n"," Downloading tomlkit-0.12.0-py3-none-any.whl (37 kB)\n","Requirement already satisfied: typer[all]<1.0,>=0.9 in /usr/local/lib/python3.10/dist-packages (from gradio) (0.9.0)\n","Requirement already satisfied: typing-extensions~=4.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (4.5.0)\n","Collecting uvicorn>=0.14.0 (from gradio)\n"," Downloading uvicorn-0.23.2-py3-none-any.whl (59 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m8.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting websockets<12.0,>=10.0 (from gradio)\n"," Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m18.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from gradio-client==0.7.0->gradio) (2023.6.0)\n","Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch) (3.12.4)\n","Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch) (1.12)\n","Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch) (3.2)\n","Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch) (2.1.0)\n","Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.10/dist-packages (from diffusers) (6.8.0)\n","Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from diffusers) (2023.6.3)\n","Collecting safetensors>=0.3.1 (from diffusers)\n"," Downloading safetensors-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m84.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting tokenizers<0.15,>=0.14 (from transformers==4.36.0.dev0)\n"," Downloading tokenizers-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.8/3.8 MB\u001b[0m \u001b[31m81.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers==4.36.0.dev0) (4.66.1)\n","Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (0.4)\n","Requirement already satisfied: jsonschema>=3.0 in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (4.19.1)\n","Requirement already satisfied: toolz in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n","Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (1.1.1)\n","Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (0.12.1)\n","Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (4.43.1)\n","Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (1.4.5)\n","Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (3.1.1)\n","Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (2.8.2)\n","Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n","Collecting annotated-types>=0.4.0 (from pydantic>=2.0->gradio)\n"," Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)\n","Collecting pydantic-core==2.10.1 (from pydantic>=2.0->gradio)\n"," Downloading pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m76.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting typing-extensions~=4.0 (from gradio)\n"," Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)\n","Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (3.3.1)\n","Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (3.4)\n","Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (2.0.7)\n","Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (2023.7.22)\n","Collecting huggingface-hub (from accelerate)\n"," Downloading huggingface_hub-0.17.3-py3-none-any.whl (295 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m295.0/295.0 kB\u001b[0m \u001b[31m34.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer[all]<1.0,>=0.9->gradio) (8.1.7)\n","Collecting colorama<0.5.0,>=0.4.3 (from typer[all]<1.0,>=0.9->gradio)\n"," Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n","Collecting shellingham<2.0.0,>=1.3.0 (from typer[all]<1.0,>=0.9->gradio)\n"," Downloading shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)\n","Requirement already satisfied: rich<14.0.0,>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer[all]<1.0,>=0.9->gradio) (13.6.0)\n","Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n"," Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: anyio<4.0.0,>=3.7.1 in /usr/local/lib/python3.10/dist-packages (from fastapi->gradio) (3.7.1)\n","Collecting starlette<0.28.0,>=0.27.0 (from fastapi->gradio)\n"," Downloading starlette-0.27.0-py3-none-any.whl (66 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hCollecting httpcore<0.19.0,>=0.18.0 (from httpx->gradio)\n"," Downloading httpcore-0.18.0-py3-none-any.whl (76 kB)\n","\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.0/76.0 kB\u001b[0m \u001b[31m10.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hRequirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->gradio) (1.3.0)\n","Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/dist-packages (from importlib-metadata->diffusers) (3.17.0)\n","Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch) (1.3.0)\n","Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<4.0.0,>=3.7.1->fastapi->gradio) (1.1.3)\n","Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n","Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\n","Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\n","Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\n","Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n","Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\n","Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (2.16.1)\n","Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.2)\n","Building wheels for collected packages: transformers, ffmpy\n"," Building wheel for transformers (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n"," Created wheel for transformers: filename=transformers-4.36.0.dev0-py3-none-any.whl size=7920934 sha256=b2a49950e9f99953136f48acaf046deabe803d97713625bdc90534382ea1b14a\n"," Stored in directory: /tmp/pip-ephem-wheel-cache-9fw4m5vv/wheels/d9/3d/ab/28ae056a634730dae1213fc3321afc3fc1d207699fe3f889cf\n"," Building wheel for ffmpy (setup.py) ... \u001b[?25l\u001b[?25hdone\n"," Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=5d975bf1c41796de7ee85ddd71f270536323e25a0045313de8ce1eafa03015ab\n"," Stored in directory: /root/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n","Successfully built transformers ffmpy\n","Installing collected packages: pydub, ffmpy, websockets, typing-extensions, tomlkit, shellingham, semantic-version, safetensors, python-multipart, orjson, h11, colorama, annotated-types, aiofiles, uvicorn, starlette, pydantic-core, huggingface-hub, httpcore, tokenizers, pydantic, httpx, diffusers, accelerate, transformers, gradio-client, fastapi, gradio\n"," Attempting uninstall: typing-extensions\n"," Found existing installation: typing_extensions 4.5.0\n"," Uninstalling typing_extensions-4.5.0:\n"," Successfully uninstalled typing_extensions-4.5.0\n"," Attempting uninstall: pydantic\n"," Found existing installation: pydantic 1.10.13\n"," Uninstalling pydantic-1.10.13:\n"," Successfully uninstalled pydantic-1.10.13\n","\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n","lida 0.0.10 requires kaleido, which is not installed.\n","llmx 0.0.15a0 requires cohere, which is not installed.\n","llmx 0.0.15a0 requires openai, which is not installed.\n","llmx 0.0.15a0 requires tiktoken, which is not installed.\n","tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible.\u001b[0m\u001b[31m\n","\u001b[0mSuccessfully installed accelerate-0.24.1 aiofiles-23.2.1 annotated-types-0.6.0 colorama-0.4.6 diffusers-0.21.4 fastapi-0.104.1 ffmpy-0.3.1 gradio-4.0.2 gradio-client-0.7.0 h11-0.14.0 httpcore-0.18.0 httpx-0.25.0 huggingface-hub-0.17.3 orjson-3.9.10 pydantic-2.4.2 pydantic-core-2.10.1 pydub-0.25.1 python-multipart-0.0.6 safetensors-0.4.0 semantic-version-2.10.0 shellingham-1.5.4 starlette-0.27.0 tokenizers-0.14.1 tomlkit-0.12.0 transformers-4.36.0.dev0 typing-extensions-4.8.0 uvicorn-0.23.2 websockets-11.0.3\n"]}],"source":["%pip install accelerate gradio torch torchvision diffusers git+https://github.com/huggingface/transformers@main"]},{"cell_type":"code","execution_count":2,"metadata":{"executionInfo":{"elapsed":15548,"status":"ok","timestamp":1699017209308,"user":{"displayName":"Lucas Ruiz","userId":"18227400269330035369"},"user_tz":-60},"id":"BACO2_fs0Db-"},"outputs":[],"source":["from transformers import AutoTokenizer, AutoModelForSeq2SeqLM\n","import torch\n","from transformers import pipeline"]},{"cell_type":"code","execution_count":3,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":938,"referenced_widgets":["7d1e457e201440d88b4a1a9daeb38caf","3d85861278aa46e7b89b76591794ff2a","e2d975fb90d84c39a2f98c0403d58a4f","c66953da4e684f86b89f236b32276d73","e669535f0ea345cd92119a8d5752437e","3a0f4dfe79ff4140aa22dea3a9223a3f","e9d94c0425bc48948ef1ab32fff4a67d","834f8b7d1a1f4c67911eac48539e5e75","799ea3f9508640b6b02b0ade6ebd0472","f2a16fe3a30642b2a67b5e70224246e4","ad35d7b8073d43d8a16a26dbb7515af6","1e594c0b7feb4678ac7b840795c8e7f1","f14680f9294a47c7b416b651535e46b7","bb3c142669eb485081ff2e00020825ec","45c5a465024d4ce3949c1cf3b622fc84","6e898e6f80c94b3499a645dfee5d9053","2f9157aabde8495eaf6bb87a6e109424","f4bf5d13e5a843f4a7caf83a0e262921","f4d16b9fed0d40f38f3513da0321ee00","c9e39f3c8dd54c1cad4db1358b7122c9","944a5d7ae32a45508d79262127093488","a8dd0a8d66cf4f00b5f112c5c0a55a9d","c3ad38bc4b124a56a6c06a831f890ed1","731832bfa3ba4311aed3fcceb040fa99","207c8d19421b42f693ca7d37f8bfb897","39d807e94cc64360abe905df12722605","bf25a6a0257748aeb06c3a05899eaaeb","4b3a0648ad114a7f9f3403285a736db5","7047d198053c4cde9d4b1093e5d92a10","58efa5a151c5466fb84cebed7dbfd42c","73387218e252445f9f46e76f1f119394","c902eca15a1d4756a613cc55d2dd9cb3","fe63aa6d1c2b496eb59c48d2304de08b","447c6b8169c44d96b2d8503da205279b","43e320eb30ef46ddb11502eb8e872404","8c9cd843ab274c2e86247888a50d1ae0","a0b21d301a7f4c19802a59a2766ab5f8","55fc7dfc7c8a4674b46bd5acd377d326","f0632473f0ad4526ac10b4d84fb9ed05","86068044f76a4b94bfcbefde2eea07a9","af5ddff71c7a4384afd70e80ef9e8418","ad74a672cbc34d9eb1622cd4885649a5","edc38d226a1d48b9ab1a9d04fe5e8b3a","5a4faa1ba8e2423a9e20aefdcefe02c5","f3659a28119149cb860747cf6ca96e93","81446aef1bcb469aaeaab06d2a7a1836","e92b7cb8c79e4367bcc2a77fff7f77a7","5c898338a94f4490a6ba282c51945d9f","974d9fdd0def429da0b87b05462a06a7","52dc5d29c1e24ef4b51ea88e5a201986","8b09b3dffa4e4178947b5250b5cb650b","8d8eec4707904c709099cfd7218d0d45","4f927b9e3eb34de38856c870e3b038c5","5f811ae4d60b4d90b6749fe6d082c266","e937f6191ed442359f0d3ba6fcf3bb95","b99d1c8439224253992053725bf14998","95d71ae64f7247908fe6672e3d479586","c08ee03a824a440583134a341240b0f4","f4349e2c0e1240db8d5a4d119ac5d132","4fa4467b02ce428cbcca47f5793f03d5","4210922217484924af1d89e7f50d4484","9b6d50eb5f03457d8f1bbf9d377a14ae","d4081643d2ce4eb68c4f58169f6e8076","49bb40085f1f432f835c8ba9815092b0","87be10185dcc4d9c8435310544930ca9","b7cd789702234c768e12951040d1b8b9","f7a22c8221c84190a02a215d6e1f16b2","b7197909f90c4d00aeb6781d91147718","5154123d93de4c399eb8cfbdb700b90c","3163bff0987e4bbe8da8bee82feb47cd","d82d0810d8bd4f30af3d6a13fd55a3c0","a89d30a3716044bc80847a0333405380","daff27c599274b019f1ed1e5e7c8de89","a9c91064d9c8442391cc6fe3b6f7f86e","d1f29df1e9af4798bcfbdf74547413fb","bd2ed5bbfe5f43bdbe00d5d2371c3242","72cd761f610f46238676c780d5e5f4ce","8cbb637a3ad44a329cd87521a205abcd","6aedf8a3ede749ee8e5b9c6289f13f8f","0ff7509ee3a24892aad461ae46af68fa","e28eb5d928864fd087776d09f8387072","adcf3bd1316f40e5ae6c62b7cf62fb11","44be767986ce42329e7d94182aed5d61","f4292a7978434c339802bb1ac150ab58","99ff263aef2046a393e5059cde0252f0","f2e2ff3e060d4e5bbc97eb1ffdcaebd7","f936c133ac1a4953bef167d3f5f7e218","49795449c3254e8393ea83ca8d82ef0c","ffeb044090fd499f81fed5bb14db3d2c","be498966618f4df3b05e3ea0b78639a2","4eb1bc6258aa4f7f840c02a891a5cf68","1426187bf9f047eea13f037b8e30e009","a3aee1891d664044a441c7072e5e7138","1e8551f39f304e308ce6a498405f3df2","1116a53a58db40ee95230e9b88a4a7ca","744a955eb95b4b4399969409c4467466","62ad1e5b11e341179e60e19d5cbf2ba2","043161d8675c46049b3cc1cb719fa210","774661a1755142d1a663173b70233228","70a9d601f9ec424180da879726b638f0","36c3ddb362dc4176985f6c942101daef","d42d9692f71c4768b243d354b0ab816e","d72b1c356a534f0995b071dc9e20e861","cfd7fa1f38a44aaaaf08662b6f9d8831","2193a45797df4a3f9b84a505a0ed96df","bdfdef0327fe485a9868493c59385b65","66909d7d62e940959c2710e946c14104","2f1dc795b73245de84e2cee08b95050e","a15fa142ef904c1f8521115fcffbe704","a218c2949baa4e2d91f5a12318c34f78","0170ea53ea47441e846c7469c1e4f23a","c84203a627284774ab51a47860aa61e0","fa4d8d0270dc41b584409f182c34818e","0dcb667c46cd404aaac4ed26b770b635","ca97c092a79d46cd9d23da559a683df8","f6d557c77492410dbd477014b516ac2c","6bc00e3dd1924dd284bff0cdeb48599d","6019ef2a5d0f408c86b3511283d03f35","5a043889aa70429885689ff6fc9fea51","55326275e7764853b5b3f9d5cfa32706","f6b426495f3d462eae9a269bd64631d9","b98beae45a794c0f86717835185e92b3","4f81e1abbf7041c4a2bc68ef3f5f6c2d","38ee79b79d5b492898d941de66ada836","36929b3c13f64f929b0d1776e0d2db0c","bb00c69316f54322a6b26d07233e0bcc","ea163eadf7994fc684ab35d6d210e23b","6316c2751041485db5765f3a22aedd25","c3e1b074dc52452080ad1e44a10471c0","841ab57427494745ac70476aa30eaf50","62db67408a9049fb8207589d2a137587","1b85c8cf830c430a9bfc8bbcf4918670","76cdccccab0c4706929272e12bcb859d","97d7b6b051c949cf8d5ae3b3a68d0228","31e7d1d38995426e94351225b6e7ecab","924dd0fe501e48aab87824807f081296","9640e1dc14564482961781017d90a5f2","bb4d86de68984808bfd4a4e0b42a3082","75cf764dabfc4a9ca9869318164e4962","96ea9fcedd1a49a486a06a66ccef2d23","53027320f95a406ca21fa223957a3b2d","4b089ee611ae4f2ca40906e59c03fb62","d320a5b7ffbe4f19a87226152b8b49de","2db27f41c9204310ab6b246ec6d5b032","3e27763bc442400cad84d053bb08ade9","a69dc534655444dab0451e87e03f4467","253b59e0e1384af498e8b004742c75d8","e3fa5f933c4c4351827789bd866edd6b","bd92dc9ba83d44ccb4cbb24080798852","fa5962c2b65c4fc2b7af729c8a9f0c58","c6ed916dab494181921bb4dad26adc3d","2469751a787d4025890c79cc7b4645b0","d1abae81d6d946cfb95acb264c91fe8d","e713274a2f444ea0a1fd10a52b1a24e5","53ff30613332453da342a4768581bfac","2f57811448704f979263d85d4d444414","d194301ab07148eda390daa69ce07854","9537ebfba95345a5b13c3d6ce2094e86","de6314639360442c973f74cefe04b411","9ea9221a533f4527bda86efdb5d4e227","50aeef9164b04b1890df4acfbf75cbc5","8bbccde6628a4d038d2549f831d1ca49","9d5b8fcb36c644dab5bded6e3ac4f6a1","37e0816efe2446d0b1a574a77503162a","b04c77ef1c484fa88e54d92a579169d6","b07e7109c1ff4ff9ad05c5542cdc072d","88007c87600b441b836b9308cec558b7","2bc4e7dcccc14ce0b2efa6552248afbe","d28f02b29e5246358172e5e91e911d7f","b38dde0254d044faa64c8ab6d6594170","1aa43a4b63aa4eb788e88ee7d0e275d9","ed4b86c2f85a4e8c93e5d10ae1be0171","604e59791598406fa0e27f3f36b24438","f53e1d698fe4446fa0d8680aa905b117","a73da2d90a184e2e945bf08200df6262","b4b65a264da744b1856422343f08d985","69a8f7397f1b4af7ae8ed13d2600a965","81292aed15d149e6a87bbd7a896ed885","102b611b27be440486ff039a63af8872","59a5108d314e4036a0df93a31879de4a","f2727c2782a949d291a84c2c96777168","c5bb1df1a31a410186a5cf487f376829","623ceccf9176473b8878c3eeaaa3a736","be280a41264f43baaef775b3daae3387","7e8e41859db74708a5d2eec4795a0d9c","34521d6e47054bddb2e26ea8a5edd420","9aafb16be7fd4aaeaca8c370d2d3e6ec","bfcd99672c3b4f58ad6030ea2d9d74bd","c8fe25e73507497d82bd2a0c9c82b4d1","79907e34504748f5b07ab8199dde9625","85bbdfe125e74000b7bde25993f6abe6","0e8f59ad5f964f39afa181e99837723a","576431cdaa4747e381de02a7de6d96e7","390f7b54eee7473f89b9fb38351c1773","74ea917798394fc4b6f7667da12b10c6","ac2b3bdd48ff46c1b0a3ee6b78b8bf70","f1b05b6d7fa24d0f9f324161f4a65aea","2250158461d94388827d4f3a61909e91","fff92932386941708149d65df1a73ebf","9c3dcc6349b24e4f968a4b48f59546f5","101073c974b64596810451b901231b10","ec4ac0b190034194afb99952ab84c87a","d306f2746f4c4d1e966b52c8a27de0aa","35acaacbfdff4e9db98a783036a1e029","1bdca32bfd014d5bbba3b3e2b7bb3d43","eeb96c3a2ac047958d990def99095a5e","264a16f4ae374b99847629d96b755277","908426e3a2dc49718bc523ad9d536559","112aa02327b54caa86197b01504b2ed8","3aad56d2690d4fb0b551517d6eeda0fc","53d11792f8054da99ac44a4a8f0b54e7","1fba397e836f42fd990f0ce0f16c116f","f09fc14943e444a8a41a5d3f77b5f652","10acbfbf28bd44d3a0d04314c562b29c","71f398d50dd44263933300c90f4735d6","b5ee0bd34ed24603a1eb1e8ef07c3219","c0fefca15a634eae85b238a052680bdc","da5ae3c069a641bd99b91d9ef02c4efa","0cf3117c253c4bb589c4c90d94e1dfe4","a4754eeb42e04048afbae530731acd18","b76c1bebc2c742b28639d253123bcf7d","8aa2d74825144ba5b903ec9be9a7ba9a","8183f324e25b4f4fa452d38a36cd29ed","b7a7976bad7b47b8a8a6a599015f2c46","e5bf91085d32458ca28f0e80e8fd1106","4aaddc450b084108957289984f5a4839","101ac92d0c07444ea1fde241a8efba05","a917b6a20db44c989ba74bceaf898587","33ab7715c8bc4707a8289c9f28facd34","fcdb1b7479724cbfa059235e96b3260f","83f80a26a1e74461a7e1d0b73aacd085","eb6ab85ba75d4a1bb016236690851577","3a40f49e32d14a0f933665e49fdd6ffc","fc13ac5095f5467bb31e95c9f002c27f","4ed2a9bda8af4cc5a1ec4b580b440ff9","64703a081b3341fa864aac6c135b46b3","9e417474bd004034ba29ca486ba40cad","2ed28ed97f7b47909342ffc43704438e","c15c4cf36c244373848e285dea908c3e","8ac0a2cf168b495fb1fc680ac4a26627","7226cd9f5168478bb9a258b5c137a961","24047f86eeeb46188098c46ade08d41d","babcb185b929430c82262a90c4380028","0b54ec51b99b464aae7cb4ef27988fc3","d4697589a4794f88a5f7d6ea334fb60f","5c61730b073e42799642ee4b2416ecb1","dd46e751ef774febad9cdcce48483a14","731358d67c204f4c8847017b98f669e5","a2f90e8ab4ea4c67b7a0e255e68ac3b9","ba5e34b468464e7f95dcef8e25b1adbe","1c69f3cc74604a8a8922803fd1682e87","f7d4312adee14673a90e6c6e88186118","71e63b6435df4be9b1cebcfaaadbc3d7","7b97e616d938448b8053bea5f46c7e64","f56d368c69764cdb996df37035a6615b","d4ce32e5768e48468a1d24c19d45c63f","637e1267dcb84e77a132c873111cd748","7709fb58a9f34df19512e7b24e1522ca","881f4c6d543a4b7fa6c0e32a1427a1c2","021f68515039445483a47f1eff0a508e","7423c8833e3548208dbbb48296f822d5","57fa06f9d98143ab9755e84e821648e7","7bd36ee3ba224651bd35a9ac9e12e0a5","190207e261304ea7aebfe62cee9fa7f4","6edba32d561c44d48b89d937954ba551","f7303ad2d9074201a76adc405ab7c5a3","5263c1b071464ccfbdfddee951d4253e","e1f8abb66d054b2b8b5a97746bc50c35","221d977fbacd4013872e1550b79cddeb","d795cebf13704444a4fea65f1aacea88","990948d87f5a485dbc4b660fce14478a","4cb8754101404967ab14166d1eb884cb","cbfd70693c464d9bb31ee226afa3a99e","d45e0dff68484df7a62dbf7e81ef3592","9ed0bd14564c47389315b0b8ae3de919","abebfd20d346469c975f5afa408b2b7d","814b36cea1604748b68a024b48ed475d","ad79e18f54df41d2a9009387696a570f","35fc5ff71e9c4e209e7cec58a99ebbee","6082ef6570ff4717a26a1d324de00652","c677af31a7414980aa0bc3be92d82930","1398c7466b4f4bd9a39c6b6650f491e7","1b2ac0bccd4843b0802540041194ce49","6e5f8339ff64488d8ff275aeb95ab900","9de2ee01c4644e4dbf8934cbfec3aa99","ebec656f034145b0967f3a1753c74060"]},"executionInfo":{"elapsed":308694,"status":"ok","timestamp":1699017517990,"user":{"displayName":"Lucas Ruiz","userId":"18227400269330035369"},"user_tz":-60},"id":"BHEVUef40Ke8","outputId":"6d967e8d-ebb2-4471-f478-30920898d547"},"outputs":[{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"7d1e457e201440d88b4a1a9daeb38caf","version_major":2,"version_minor":0},"text/plain":["Downloading (…)okenizer_config.json: 0%| | 0.00/1.33k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"1e594c0b7feb4678ac7b840795c8e7f1","version_major":2,"version_minor":0},"text/plain":["Downloading (…)olve/main/vocab.json: 0%| | 0.00/798k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"c3ad38bc4b124a56a6c06a831f890ed1","version_major":2,"version_minor":0},"text/plain":["Downloading (…)olve/main/merges.txt: 0%| | 0.00/456k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"447c6b8169c44d96b2d8503da205279b","version_major":2,"version_minor":0},"text/plain":["Downloading (…)/main/tokenizer.json: 0%| | 0.00/2.11M [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"f3659a28119149cb860747cf6ca96e93","version_major":2,"version_minor":0},"text/plain":["Downloading (…)cial_tokens_map.json: 0%| | 0.00/280 [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"b99d1c8439224253992053725bf14998","version_major":2,"version_minor":0},"text/plain":["Downloading (…)lve/main/config.json: 0%| | 0.00/1.64k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"f7a22c8221c84190a02a215d6e1f16b2","version_major":2,"version_minor":0},"text/plain":["Downloading tf_model.h5: 0%| | 0.00/1.63G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"name":"stderr","output_type":"stream","text":["All TF 2.0 model weights were used when initializing BartForConditionalGeneration.\n","\n","Some weights of BartForConditionalGeneration were not initialized from the TF 2.0 model and are newly initialized: ['model.encoder.embed_tokens.weight', 'model.decoder.embed_tokens.weight', 'lm_head.weight', 'lm_head.weight']\n","You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"]},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"8cbb637a3ad44a329cd87521a205abcd","version_major":2,"version_minor":0},"text/plain":["Downloading (…)neration_config.json: 0%| | 0.00/358 [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"ffeb044090fd499f81fed5bb14db3d2c","version_major":2,"version_minor":0},"text/plain":["Downloading (…)lve/main/config.json: 0%| | 0.00/628 [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"70a9d601f9ec424180da879726b638f0","version_major":2,"version_minor":0},"text/plain":["Downloading (…)fetensors.index.json: 0%| | 0.00/23.9k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"0170ea53ea47441e846c7469c1e4f23a","version_major":2,"version_minor":0},"text/plain":["Downloading shards: 0%| | 0/8 [00:00, ?it/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"b98beae45a794c0f86717835185e92b3","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.89G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"76cdccccab0c4706929272e12bcb859d","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.95G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"2db27f41c9204310ab6b246ec6d5b032","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.98G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"53ff30613332453da342a4768581bfac","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.95G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"b07e7109c1ff4ff9ad05c5542cdc072d","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.98G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"69a8f7397f1b4af7ae8ed13d2600a965","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.95G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"bfcd99672c3b4f58ad6030ea2d9d74bd","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/1.98G [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"fff92932386941708149d65df1a73ebf","version_major":2,"version_minor":0},"text/plain":["Downloading (…)of-00008.safetensors: 0%| | 0.00/816M [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"3aad56d2690d4fb0b551517d6eeda0fc","version_major":2,"version_minor":0},"text/plain":["Loading checkpoint shards: 0%| | 0/8 [00:00, ?it/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"b76c1bebc2c742b28639d253123bcf7d","version_major":2,"version_minor":0},"text/plain":["Downloading (…)neration_config.json: 0%| | 0.00/111 [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"eb6ab85ba75d4a1bb016236690851577","version_major":2,"version_minor":0},"text/plain":["Downloading (…)okenizer_config.json: 0%| | 0.00/1.43k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"babcb185b929430c82262a90c4380028","version_major":2,"version_minor":0},"text/plain":["Downloading tokenizer.model: 0%| | 0.00/493k [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"7b97e616d938448b8053bea5f46c7e64","version_major":2,"version_minor":0},"text/plain":["Downloading (…)/main/tokenizer.json: 0%| | 0.00/1.80M [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"6edba32d561c44d48b89d937954ba551","version_major":2,"version_minor":0},"text/plain":["Downloading (…)in/added_tokens.json: 0%| | 0.00/42.0 [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"},{"data":{"application/vnd.jupyter.widget-view+json":{"model_id":"abebfd20d346469c975f5afa408b2b7d","version_major":2,"version_minor":0},"text/plain":["Downloading (…)cial_tokens_map.json: 0%| | 0.00/168 [00:00, ?B/s]"]},"metadata":{},"output_type":"display_data"}],"source":["# chatgpt-gpt4-prompts-bart-large-cnn-samsum\n","tokenizer = AutoTokenizer.from_pretrained(\"Kaludi/chatgpt-gpt4-prompts-bart-large-cnn-samsum\")\n","model = AutoModelForSeq2SeqLM.from_pretrained(\"Kaludi/chatgpt-gpt4-prompts-bart-large-cnn-samsum\", from_tf=True)\n","\n","# zephyr\n","pipe = pipeline(\"text-generation\", model=\"HuggingFaceH4/zephyr-7b-alpha\", torch_dtype=torch.bfloat16, device_map=\"auto\")\n","\n","def useZephyr(prompt):\n"," messages = [\n"," {\n"," \"role\": \"system\",\n"," \"content\": \"You are a friendly chatbot who always responds in the style of a pirate.\",\n"," },\n"," {\"role\": \"user\", \"content\": prompt},\n"," ]\n"," # https://huggingface.co/docs/transformers/main/en/chat_templating\n"," prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)\n"," print(prompt)\n","\n"," outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)\n"," return outputs[0][\"generated_text\"]"]},{"cell_type":"code","execution_count":4,"metadata":{"executionInfo":{"elapsed":4,"status":"ok","timestamp":1699017517990,"user":{"displayName":"Lucas Ruiz","userId":"18227400269330035369"},"user_tz":-60},"id":"pL1isZHpY6DF"},"outputs":[],"source":["def generatePrompt(prompt, max_new_tokens):\n"," batch = tokenizer(prompt, return_tensors=\"pt\")\n"," generated_ids = model.generate(batch[\"input_ids\"], max_new_tokens=int(max_new_tokens))\n"," output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)\n"," prompt = output[0]\n","\n"," return useZephyr(prompt)\n","\n","def generate_test(prompt):\n"," batch = tokenizer(prompt, return_tensors=\"pt\")\n"," generated_ids = model.generate(batch[\"input_ids\"], max_new_tokens=150)\n"," output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)\n"," return output[0]\n","\n","def generate_prompt(prompt, max_new_tokens):\n"," return generatePrompt(prompt, max_new_tokens)\n","#"]},{"cell_type":"code","execution_count":5,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":646},"executionInfo":{"elapsed":7653,"status":"ok","timestamp":1699017525641,"user":{"displayName":"Lucas Ruiz","userId":"18227400269330035369"},"user_tz":-60},"id":"U9q8eO_faoVX","outputId":"67b4e6dc-6b5d-40b8-d64d-882f249568d0"},"outputs":[{"name":"stdout","output_type":"stream","text":["Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n","\n","Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n","Running on public URL: https://dbb2efcc3beb268bb9.gradio.live\n","\n","This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"]},{"data":{"text/html":["
"],"text/plain":["