Skip to content

Commit 18c2cb0

Browse files
committed
numpy version, video WIP
1 parent 6a87d49 commit 18c2cb0

File tree

6 files changed

+62
-64
lines changed

6 files changed

+62
-64
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
bunny.webm
1+
*.mp4
2+
*.webm
23
.build
34
Pulumi.*.yaml
45

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ brew install pyenv
99
brew install curl
1010
brew install jq
1111
brew install redis
12-
brew install gcloud
13-
brew install awscli
12+
brew install ffmpeg
13+
brew install mpv
1414
brew install --cask docker # probably this, didn't test
1515

1616
pip install poetry

poetry.lock

Lines changed: 39 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies = [
2323
"spacy (>=3.8.5,<4.0.0)",
2424
"nltk (>=3.9.1,<4.0.0)",
2525
"yake (>=0.4.8,<0.5.0)",
26+
"numpy (>=1.24.0,<2.0.0)",
2627
]
2728

2829
[build-system]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mdurl==0.1.2 ; python_version == "3.11"
4040
murmurhash==1.0.12 ; python_version == "3.11"
4141
networkx==3.4.2 ; python_version == "3.11"
4242
nltk==3.9.1 ; python_version == "3.11"
43-
numpy==2.2.4 ; python_version == "3.11"
43+
numpy==1.26.4 ; python_version == "3.11"
4444
opentelemetry-api==1.31.1 ; python_version == "3.11"
4545
opentelemetry-distro==0.52b1 ; python_version == "3.11"
4646
opentelemetry-exporter-otlp-proto-common==1.31.1 ; python_version == "3.11"

tasks.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import requests # type: ignore
99
import structlog
1010

11-
from .src import bsky, cache
12-
from .src import worker
11+
from src import bsky, cache
12+
from src import worker
1313

1414
dotenv.load_dotenv()
1515
bsky_instance = bsky.Bsky()
@@ -101,3 +101,18 @@ def bsky_emoji_summary(ctx: invoke.Context, handle: str, num_keywords: int = 25,
101101
worker.process_emoji_summary(bsky_instance.client, task_id, handle, num_keywords, num_feed_pages)
102102
)
103103
print(json.dumps(results, indent=2))
104+
105+
106+
@invoke.task
107+
def stream_video(path: str, chunk_size: int = 25 * 1024):
108+
with open(path, "rb") as f:
109+
size = f.__sizeof__()
110+
read_size = 0
111+
112+
while True:
113+
chunk = f.read(chunk_size)
114+
if not chunk:
115+
break
116+
yield chunk
117+
read_size += chunk_size
118+
print(f"{read_size / size * 100}%")

0 commit comments

Comments
 (0)