{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "f41437ec-ce1b-4acb-bc47-9c44eb5fdb4d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Looking in indexes: http://mirrors.aliyun.com/pypi/simple\n", "Collecting huggingface\n", " Downloading http://mirrors.aliyun.com/pypi/packages/f4/8c/e61fbc39c0a37140e1d4941c4af29e2d53bacf9f4559e3de24d8f4e484f0/huggingface-0.0.1-py3-none-any.whl (2.5 kB)\n", "Installing collected packages: huggingface\n", "Successfully installed huggingface-0.0.1\n", "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n", "\u001b[0mNote: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ "pip install huggingface" ] }, { "cell_type": "code", "execution_count": 6, "id": "bd8448cc-31a3-4f70-bf0f-4d0fdd817c20", "metadata": {}, "outputs": [], "source": [ "\n", "import subprocess\n", "import os\n", "\n", "result = subprocess.run('bash -c \"source /etc/network_turbo && env | grep proxy\"', shell=True, capture_output=True, text=True)\n", "output = result.stdout\n", "for line in output.splitlines():\n", " if '=' in line:\n", " var, value = line.split('=', 1)\n", " os.environ[var] = value" ] }, { "cell_type": "code", "execution_count": null, "id": "7636af72-782b-4aaf-9f86-8412aa965405", "metadata": {}, "outputs": [], "source": [ "from huggingface_hub import HfApi\n", "api = HfApi()\n", "\n", "api.upload_folder(\n", " folder_path=\"\",\n", " repo_id=\"kevinwang676/MuseTalk\",\n", " repo_type=\"space\",\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "fe75559a-a4ae-435b-87f8-c7e25b0b6852", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.10.8" } }, "nbformat": 4, "nbformat_minor": 5 }