npcpy 1.1.28__py3-none-any.whl → 1.2.32__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- npcpy/data/audio.py +16 -38
- npcpy/data/image.py +29 -29
- npcpy/data/load.py +4 -3
- npcpy/data/text.py +28 -28
- npcpy/data/video.py +6 -6
- npcpy/data/web.py +49 -21
- npcpy/ft/__init__.py +0 -0
- npcpy/ft/diff.py +110 -0
- npcpy/ft/ge.py +115 -0
- npcpy/ft/memory_trainer.py +171 -0
- npcpy/ft/model_ensembler.py +357 -0
- npcpy/ft/rl.py +360 -0
- npcpy/ft/sft.py +248 -0
- npcpy/ft/usft.py +128 -0
- npcpy/gen/audio_gen.py +24 -0
- npcpy/gen/embeddings.py +13 -13
- npcpy/gen/image_gen.py +37 -15
- npcpy/gen/response.py +287 -111
- npcpy/gen/video_gen.py +10 -9
- npcpy/llm_funcs.py +447 -79
- npcpy/memory/command_history.py +201 -48
- npcpy/memory/kg_vis.py +74 -74
- npcpy/memory/knowledge_graph.py +482 -115
- npcpy/memory/memory_processor.py +81 -0
- npcpy/memory/search.py +70 -70
- npcpy/mix/debate.py +192 -3
- npcpy/npc_compiler.py +1541 -879
- npcpy/npc_sysenv.py +250 -78
- npcpy/serve.py +1036 -321
- npcpy/sql/ai_function_tools.py +257 -0
- npcpy/sql/database_ai_adapters.py +186 -0
- npcpy/sql/database_ai_functions.py +163 -0
- npcpy/sql/model_runner.py +19 -19
- npcpy/sql/npcsql.py +706 -507
- npcpy/sql/sql_model_compiler.py +156 -0
- npcpy/tools.py +20 -20
- npcpy/work/plan.py +8 -8
- npcpy/work/trigger.py +3 -3
- {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/METADATA +169 -9
- npcpy-1.2.32.dist-info/RECORD +54 -0
- npcpy-1.1.28.dist-info/RECORD +0 -40
- {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/WHEEL +0 -0
- {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/licenses/LICENSE +0 -0
- {npcpy-1.1.28.dist-info → npcpy-1.2.32.dist-info}/top_level.txt +0 -0
npcpy/gen/video_gen.py
CHANGED
|
@@ -16,7 +16,7 @@ def generate_video_diffusers(
|
|
|
16
16
|
import os
|
|
17
17
|
import cv2
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
pipe = DiffusionPipeline.from_pretrained(
|
|
21
21
|
"damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float32
|
|
22
22
|
).to(device)
|
|
@@ -32,7 +32,7 @@ def generate_video_diffusers(
|
|
|
32
32
|
|
|
33
33
|
def save_frames_to_video(frames, output_path, fps=8):
|
|
34
34
|
"""Handle the specific 5D array format (1, num_frames, H, W, 3) with proper type conversion"""
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
if not (
|
|
37
37
|
isinstance(frames, np.ndarray)
|
|
38
38
|
and frames.ndim == 5
|
|
@@ -42,20 +42,20 @@ def generate_video_diffusers(
|
|
|
42
42
|
f"Unexpected frame format. Expected 5D RGB array, got {frames.shape}"
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
frames = (frames[0] * 255).astype(np.uint8)
|
|
45
|
+
|
|
46
|
+
frames = (frames[0] * 255).astype(np.uint8)
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
height, width = frames.shape[1:3]
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
fourcc = cv2.VideoWriter_fourcc(*"mp4v")
|
|
53
53
|
video_writer = cv2.VideoWriter(output_path, fourcc, fps, (width, height))
|
|
54
54
|
|
|
55
55
|
if not video_writer.isOpened():
|
|
56
56
|
raise IOError(f"Could not open video writer for {output_path}")
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
for frame in frames:
|
|
60
60
|
video_writer.write(cv2.cvtColor(frame, cv2.COLOR_RGB2BGR))
|
|
61
61
|
|
|
@@ -71,9 +71,10 @@ def generate_video_diffusers(
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
def generate_video_veo3(
|
|
76
76
|
prompt: str,
|
|
77
|
+
model: str,
|
|
77
78
|
negative_prompt: str = "",
|
|
78
79
|
output_path: str = "",
|
|
79
80
|
):
|
|
@@ -93,7 +94,7 @@ def generate_video_veo3(
|
|
|
93
94
|
config.negative_prompt = negative_prompt
|
|
94
95
|
|
|
95
96
|
operation = client.models.generate_videos(
|
|
96
|
-
model=
|
|
97
|
+
model=model,
|
|
97
98
|
prompt=prompt,
|
|
98
99
|
config=config,
|
|
99
100
|
)
|