mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
feat: add support for pipeline config in get_pipeline (#1930)
This commit is contained in:
1 parent
f4ce929ca1
commit
de51e9fc15
2 files changed
+13
-3
No files matched your search
@@ -1,5 +1,9 @@
|
||||
# CHANGELOG
|
||||
|
||||
## Next
|
||||
|
||||
- feat: allow passing preloaded pipeline config to `get_pipeline`
|
||||
|
||||
## Version 4.0.0 (2025-09-29)
|
||||
|
||||
### TL;DR
|
||||
|
||||
@@ -46,9 +46,15 @@ def get_pipeline(
|
||||
_pipeline = Pipeline.from_pretrained(pipeline, token=token, cache_dir=cache_dir)
|
||||
|
||||
elif isinstance(pipeline, dict):
|
||||
pipeline.setdefault("token", token)
|
||||
pipeline.setdefault("cache_dir", cache_dir)
|
||||
_pipeline = Pipeline.from_pretrained(**pipeline)
|
||||
if "checkpoint" in pipeline:
|
||||
pipeline.setdefault("token", token)
|
||||
pipeline.setdefault("cache_dir", cache_dir)
|
||||
_pipeline = Pipeline.from_pretrained(**pipeline)
|
||||
|
||||
else:
|
||||
_pipeline = Pipeline.from_pretrained(
|
||||
pipeline, token=token, cache_dir=cache_dir
|
||||
)
|
||||
|
||||
else:
|
||||
raise TypeError(
|
||||
|
||||
Reference in new issue
Block a user