chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
cloud_id: {{ env["ANYSCALE_CLOUD_ID"] }}
|
||||
region: us-west-2
|
||||
|
||||
# Cluster resources
|
||||
head_node_type:
|
||||
name: head
|
||||
instance_type: m5.2xlarge
|
||||
resources:
|
||||
cpu: 8
|
||||
|
||||
worker_node_types:
|
||||
- name: 16CPU-64GB
|
||||
instance_type: m8i.4xlarge
|
||||
min_workers: 1
|
||||
max_workers: 32
|
||||
- name: 4CPU-16GB-1GPU
|
||||
instance_type: g6.xlarge
|
||||
min_workers: 1
|
||||
max_workers: 32
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
# Install Python dependencies
|
||||
pip3 install --no-cache-dir \
|
||||
"numpy>=1.24.0,<2.0" \
|
||||
"torch>=2.0.0" \
|
||||
"transformers>=4.35.0" \
|
||||
"accelerate>=0.25.0" \
|
||||
"sentencepiece>=0.1.99" \
|
||||
"httpx>=0.25.0" \
|
||||
"aioboto3>=12.0.0" \
|
||||
"pillow>=10.0.0"
|
||||
|
||||
|
||||
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
|
||||
ffmpeg \
|
||||
&& sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
export S3_BUCKET=anyscale-example-video-analysis-test-bucket
|
||||
@@ -0,0 +1,19 @@
|
||||
cloud_id: {{ env["ANYSCALE_CLOUD_ID"] }} # required; set by CI
|
||||
region: us-central1
|
||||
|
||||
# Cluster resources
|
||||
head_node_type:
|
||||
name: head
|
||||
instance_type: n1-standard-8
|
||||
resources:
|
||||
cpu: 8
|
||||
|
||||
worker_node_types:
|
||||
- name: 16CPU-64GB-GPU
|
||||
instance_type: n4-standard-16
|
||||
min_workers: 1
|
||||
max_workers: 32
|
||||
- name: 4CPU-16GB-GPU
|
||||
instance_type: g2-standard-4
|
||||
min_workers: 1
|
||||
max_workers: 32
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import nbformat
|
||||
|
||||
|
||||
def convert_notebook(input_path: str, output_path: str) -> None:
|
||||
"""
|
||||
Read a Jupyter notebook and write a Python script.
|
||||
Cells that load or autoreload extensions are ignored.
|
||||
"""
|
||||
nb = nbformat.read(input_path, as_version=4)
|
||||
with open(output_path, "w") as out:
|
||||
for cell in nb.cells:
|
||||
if cell.cell_type != "code":
|
||||
continue
|
||||
|
||||
lines = cell.source.splitlines()
|
||||
# Skip cells that load or autoreload extensions
|
||||
if any(
|
||||
l.strip().startswith("%load_ext autoreload")
|
||||
or l.strip().startswith("%autoreload all")
|
||||
for l in lines
|
||||
):
|
||||
continue
|
||||
|
||||
out.write(cell.source.rstrip() + "\n\n")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Convert a Jupyter notebook to a Python script."
|
||||
)
|
||||
parser.add_argument("input_nb", help="Path to the input .ipynb file")
|
||||
parser.add_argument("output_py", help="Path for the output .py script")
|
||||
args = parser.parse_args()
|
||||
convert_notebook(args.input_nb, args.output_py)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
S3_BUCKET=anyscale-example-video-analysis-test-bucket
|
||||
|
||||
export S3_BUCKET
|
||||
|
||||
python ci/nb2py.py README.ipynb README.py # convert notebook to py script
|
||||
python README.py
|
||||
rm README.py # remove the generated script
|
||||
Reference in New Issue
Block a user