Spaces:
Running
Running
Delete Next_Servo.ipynb
Browse files- Next_Servo.ipynb +0 -37
Next_Servo.ipynb
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"nbformat_minor": 5,
|
| 3 |
-
"nbformat": 4,
|
| 4 |
-
"cells": [
|
| 5 |
-
{
|
| 6 |
-
"id": "intro",
|
| 7 |
-
"source": [
|
| 8 |
-
"# Next Servo",
|
| 9 |
-
"Upload Next_Servo_HF.zip to rerun the benchmark and create the video."
|
| 10 |
-
],
|
| 11 |
-
"metadata": {},
|
| 12 |
-
"cell_type": "markdown"
|
| 13 |
-
},
|
| 14 |
-
{
|
| 15 |
-
"execution_count": null,
|
| 16 |
-
"outputs": [],
|
| 17 |
-
"id": "run",
|
| 18 |
-
"source": "from google.colab import files\nfrom pathlib import Path\nfrom zipfile import ZipFile\nimport subprocess\nimport sys\n\narchive = Path(\"/content/Next_Servo_HF.zip\")\nif not archive.exists():\n uploaded = files.upload()\n archive = Path(next(name for name in uploaded if name.lower().endswith(\".zip\")))\nrun = Path(\"/content/next-servo\")\nrun.mkdir(exist_ok=True)\nwith ZipFile(archive) as source:\n for name in (\"servo.py\", \"evaluate.py\", \"render.py\"):\n (run / name).write_bytes(source.read(name))\nfor script in (\"evaluate.py\", \"render.py\"):\n subprocess.run([sys.executable, script], cwd=run, check=True)\nfiles.download(str(run / \"replay.mp4\"))",
|
| 19 |
-
"cell_type": "code",
|
| 20 |
-
"metadata": {}
|
| 21 |
-
},
|
| 22 |
-
{
|
| 23 |
-
"id": "publish",
|
| 24 |
-
"cell_type": "code",
|
| 25 |
-
"metadata": {},
|
| 26 |
-
"execution_count": null,
|
| 27 |
-
"outputs": [],
|
| 28 |
-
"source": "from pathlib import Path\nfrom tempfile import TemporaryDirectory\nfrom zipfile import ZipFile\nfrom getpass import getpass\nfrom huggingface_hub import HfApi\n\narchive = Path(\"/content/Next_Servo_HF.zip\")\nif not archive.exists():\n from google.colab import files\n uploaded = files.upload()\n archive = Path(next(name for name in uploaded if name.lower().endswith(\".zip\")))\nrepo = \"thelamapi/Next-Servo\"\ntoken = getpass(\"Hugging Face write token: \").strip()\napi = HfApi(token=token)\napi.whoami()\nwith TemporaryDirectory() as temp, ZipFile(archive) as bundle:\n stage = Path(temp)\n members = (\n \"README.md\", \"app.py\", \"servo.py\", \"evaluate.py\", \"render.py\",\n \"requirements.txt\", \"evaluation.json\", \"Next_Servo.ipynb\",\n \"preview.png\", \"replay.mp4\",\n )\n for name in members:\n (stage / name).write_bytes(bundle.read(name))\n api.create_repo(repo, repo_type=\"space\", space_sdk=\"gradio\", exist_ok=True)\n commit = api.upload_folder(\n folder_path=stage, repo_id=repo, repo_type=\"space\",\n commit_message=\"Release Next Servo with benchmark and 14-second replay\",\n )\n remote = set(api.list_repo_files(repo, repo_type=\"space\", revision=commit.oid))\n assert set(members) <= remote, sorted(set(members) - remote)\nprint(commit.commit_url)\nprint(f\"https://huggingface.co/spaces/{repo}\")\n"
|
| 29 |
-
}
|
| 30 |
-
],
|
| 31 |
-
"metadata": {
|
| 32 |
-
"kernelspec": {
|
| 33 |
-
"name": "python3",
|
| 34 |
-
"display_name": "Python 3"
|
| 35 |
-
}
|
| 36 |
-
}
|
| 37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|