Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

seamless_s2st.py 2.3 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  1. # Copyright (c) Meta Platforms, Inc. and affiliates
  2. # All rights reserved.
  3. #
  4. # This source code is licensed under the license found in the
  5. # MIT_LICENSE file in the root directory of this source tree.
  6. from seamless_communication.streaming.agents.detokenizer import UnitYDetokenizerAgent
  7. from seamless_communication.streaming.agents.offline_w2v_bert_encoder import (
  8. OfflineWav2VecBertEncoderAgent,
  9. )
  10. from seamless_communication.streaming.agents.online_feature_extractor import (
  11. OnlineFeatureExtractorAgent,
  12. )
  13. from seamless_communication.streaming.agents.online_text_decoder import (
  14. UnitYMMATextDecoderAgent,
  15. )
  16. from seamless_communication.streaming.agents.online_unit_decoder import (
  17. NARUnitYUnitDecoderAgent,
  18. )
  19. from seamless_communication.streaming.agents.pretssel_vocoder import (
  20. PretsselVocoderAgent,
  21. )
  22. from seamless_communication.streaming.agents.dual_vocoder_agent import (
  23. DualVocoderAgent,
  24. )
  25. from seamless_communication.streaming.agents.silero_vad import SileroVADAgent
  26. from seamless_communication.streaming.agents.unity_pipeline import (
  27. UnitYAgentPipeline,
  28. UnitYAgentTreePipeline,
  29. )
  30. class SeamlessS2STAgent(UnitYAgentPipeline):
  31. pipeline = [
  32. OnlineFeatureExtractorAgent,
  33. OfflineWav2VecBertEncoderAgent,
  34. UnitYMMATextDecoderAgent,
  35. NARUnitYUnitDecoderAgent,
  36. PretsselVocoderAgent,
  37. ]
  38. class SeamlessS2STJointVADAgent(UnitYAgentTreePipeline):
  39. pipeline = {
  40. SileroVADAgent: [OnlineFeatureExtractorAgent],
  41. OnlineFeatureExtractorAgent: [OfflineWav2VecBertEncoderAgent],
  42. OfflineWav2VecBertEncoderAgent: [UnitYMMATextDecoderAgent],
  43. UnitYMMATextDecoderAgent: [UnitYDetokenizerAgent, NARUnitYUnitDecoderAgent],
  44. UnitYDetokenizerAgent: [],
  45. NARUnitYUnitDecoderAgent: [PretsselVocoderAgent],
  46. PretsselVocoderAgent: [],
  47. }
  48. class SeamlessS2STDualVocoderVADAgent(UnitYAgentTreePipeline):
  49. pipeline = {
  50. SileroVADAgent: [OnlineFeatureExtractorAgent],
  51. OnlineFeatureExtractorAgent: [OfflineWav2VecBertEncoderAgent],
  52. OfflineWav2VecBertEncoderAgent: [UnitYMMATextDecoderAgent],
  53. UnitYMMATextDecoderAgent: [UnitYDetokenizerAgent, NARUnitYUnitDecoderAgent],
  54. UnitYDetokenizerAgent: [],
  55. NARUnitYUnitDecoderAgent: [DualVocoderAgent],
  56. DualVocoderAgent: [],
  57. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...