sinapsis 0.2.3__tar.gz → 0.2.4__tar.gz

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.
Files changed (21) hide show
  1. {sinapsis-0.2.3 → sinapsis-0.2.4}/PKG-INFO +1 -1
  2. {sinapsis-0.2.3 → sinapsis-0.2.4}/pyproject.toml +1 -1
  3. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/webapp/agent_gradio_helper.py +2 -3
  4. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/webapp/tts_base.py +9 -13
  5. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis.egg-info/PKG-INFO +1 -1
  6. {sinapsis-0.2.3 → sinapsis-0.2.4}/LICENSE +0 -0
  7. {sinapsis-0.2.3 → sinapsis-0.2.4}/README.md +0 -0
  8. {sinapsis-0.2.3 → sinapsis-0.2.4}/setup.cfg +0 -0
  9. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/__init__.py +0 -0
  10. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/bin/sinapsis_cli.py +0 -0
  11. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/templates/__init__.py +0 -0
  12. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/templates/display_hello_world.py +0 -0
  13. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/templates/hello_world.py +0 -0
  14. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/webapp/__init__.py +0 -0
  15. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/webapp/agent_webapp_utils.py +0 -0
  16. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis/webapp/chatbot_base.py +0 -0
  17. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis.egg-info/SOURCES.txt +0 -0
  18. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis.egg-info/dependency_links.txt +0 -0
  19. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis.egg-info/entry_points.txt +0 -0
  20. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis.egg-info/requires.txt +0 -0
  21. {sinapsis-0.2.3 → sinapsis-0.2.4}/src/sinapsis.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sinapsis
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Modular and Universal AI platform
5
5
  Author-email: SinapsisAI <dev@sinapsis.tech>
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sinapsis"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "Modular and Universal AI platform"
5
5
  authors = [
6
6
  {name = "SinapsisAI", email = "dev@sinapsis.tech"},
@@ -119,12 +119,11 @@ def add_logo_and_title(page_title: str | None = None) -> None:
119
119
  gr.Image(
120
120
  logo_path,
121
121
  elem_id="sinapsis-logo",
122
- width=800,
123
- height=150,
122
+ height=50,
124
123
  show_label=False,
125
124
  show_download_button=False,
126
125
  show_fullscreen_button=False,
127
- scale=0.5,
126
+ scale=1,
128
127
  )
129
128
 
130
129
  gr.Markdown(f"# {page_title}", elem_id="title")
@@ -17,7 +17,7 @@ class BaseTTSApp:
17
17
  def __init__(
18
18
  self,
19
19
  config_file: str,
20
- generic_key: str | None = None,
20
+ generic_key_or_base_path: str | None = None,
21
21
  framework: str = "Elevenlabs",
22
22
  task: str = "Text-to-Speech",
23
23
  ) -> None:
@@ -27,7 +27,8 @@ class BaseTTSApp:
27
27
  Args:
28
28
  config_file (str): Path to the configuration file for the TTS application, which contains
29
29
  necessary settings and parameters.
30
- generic_key (str | None): Optional key to access the container's generic data from.
30
+ generic_key_or_base_path (str | None): Optional key to access the container's generic data or the base_path
31
+ where audios are located
31
32
  framework (str, optional): The name of the framework to be used in the user interface title.
32
33
  Defaults to Elevenlabs.
33
34
  task (str, optional): The task to be performed by the application (default is "Text-to-Speech").
@@ -36,7 +37,7 @@ class BaseTTSApp:
36
37
  self.config_file = config_file
37
38
  self.framework = framework
38
39
  self.task = task
39
- self.generic_key = generic_key
40
+ self.generic_key_or_base_path = generic_key_or_base_path
40
41
 
41
42
  def init_agent(self) -> tuple[Agent, bool]:
42
43
  """
@@ -82,7 +83,7 @@ class BaseTTSApp:
82
83
  agent = cast(Agent, agent)
83
84
  container = DataContainer(texts=[TextPacket(content=text_to_convert)])
84
85
  output_container = agent(container)
85
- audio_path = self._postprocess_output(output_container, self.generic_key)
86
+ audio_path = self._postprocess_output(output_container, self.generic_key_or_base_path)
86
87
  if audio_path:
87
88
  return gr.Audio(audio_path, visible=True), None
88
89
  raise gr.Error("Unable to generate speech")
@@ -101,8 +102,6 @@ class BaseTTSApp:
101
102
  initialized_state = gr.State(False)
102
103
  interface.load(self.init_agent, outputs=[agent_state, initialized_state])
103
104
 
104
- title: str = f"# Sinapsis {self.framework} {self.task} demo"
105
- gr.Markdown(title)
106
105
  text_to_convert = gr.Textbox(
107
106
  submit_btn=True,
108
107
  label="Text to convert:",
@@ -126,18 +125,15 @@ class BaseTTSApp:
126
125
  Invokes the Gradio interface and displays the TTS functionality.
127
126
  """
128
127
  with gr.Blocks() as tts_interface:
129
- add_logo_and_title("Sinapsis text-to-speech")
128
+ add_logo_and_title(f"Sinapsis {self.framework} {self.task} demo")
130
129
  self.inner_tts_functionality(tts_interface)
131
130
  return tts_interface
132
131
 
133
132
 
134
133
  class TTSAppAudioFromPacket(BaseTTSApp):
135
- BASE_AUDIO_PATH: str
136
134
  """
137
- A subclass of BaseTTSApp for implementing text-to-speech functionality using F5TTS.
138
-
139
- This class overrides the abstract methods from BaseTTSApp to provide specific preprocessing
140
- and postprocessing steps for the F5TTS application.
135
+ A subclass of BaseTTSApp for implementing text-to-speech functionality extracting the audio path
136
+ from the generic_data field of Containers.
141
137
  """
142
138
 
143
139
  def _postprocess_output(self, container: DataContainer, generic_key: str | None) -> str | None:
@@ -148,7 +144,7 @@ class TTSAppAudioFromPacket(BaseTTSApp):
148
144
 
149
145
  audio = container.audios[-1]
150
146
  audio_path = f"{audio.source}-{audio.id.split('-')[0]}"
151
- audio_path = f"{self.BASE_AUDIO_PATH}/{audio_path}.wav"
147
+ audio_path = f"{self.generic_key_or_base_path}/{audio_path}.wav"
152
148
  return audio_path
153
149
 
154
150
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sinapsis
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Modular and Universal AI platform
5
5
  Author-email: SinapsisAI <dev@sinapsis.tech>
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes