smallestai 3.0.2__py3-none-any.whl → 3.1.0__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.

Potentially problematic release.


This version of smallestai might be problematic. Click here for more details.

@@ -89,9 +89,9 @@ class AsyncWavesClient:
89
89
  return False
90
90
 
91
91
 
92
- def get_languages(self) -> List[str]:
92
+ def get_languages(self, model="lightning") -> List[str]:
93
93
  """Returns a list of available languages."""
94
- return get_smallest_languages()
94
+ return get_smallest_languages(model)
95
95
 
96
96
  def get_cloned_voices(self) -> str:
97
97
  """Returns a list of your cloned voices."""
@@ -176,7 +176,7 @@ class AsyncWavesClient:
176
176
  validate_input(text, opts.model, opts.sample_rate, opts.speed, opts.consistency, opts.similarity, opts.enhancement)
177
177
 
178
178
  self.chunk_size = 250
179
- if opts.model == 'lightning-large':
179
+ if opts.model == 'lightning-large' or opts.model == "lightning-v2":
180
180
  self.chunk_size = 140
181
181
 
182
182
  chunks = chunk_text(text, self.chunk_size)
@@ -192,7 +192,7 @@ class AsyncWavesClient:
192
192
  "model": opts.model
193
193
  }
194
194
 
195
- if opts.model == "lightning-large":
195
+ if opts.model == "lightning-large" or opts.model == "lightning-v2":
196
196
  if opts.consistency is not None:
197
197
  payload["consistency"] = opts.consistency
198
198
  if opts.similarity is not None:
@@ -1,5 +1,8 @@
1
- TTSLanguages = ["en", "hi"]
1
+ TTSLanguages_lightning = ["en", "hi"]
2
+ TTSLanguages_lightning_large = ["en", "hi"]
3
+ TTSLanguages_lightning_v2 = ["en", "hi", "mr", "kn", "ta", "bn", "gu", "de", "fr", "es", "it", "pl", "nl", "ru", "ar", "he"]
2
4
  TTSModels = [
3
5
  "lightning",
4
- "lightning-large"
5
- ]
6
+ "lightning-large",
7
+ "lightning-v2"
8
+ ]
smallestai/waves/utils.py CHANGED
@@ -6,7 +6,7 @@ from pydub import AudioSegment
6
6
  from dataclasses import dataclass
7
7
 
8
8
  from smallestai.waves.exceptions import ValidationError
9
- from smallestai.waves.models import TTSModels, TTSLanguages
9
+ from smallestai.waves.models import TTSModels, TTSLanguages_lightning, TTSLanguages_lightning_large, TTSLanguages_lightning_v2
10
10
 
11
11
 
12
12
  API_BASE_URL = "https://waves-api.smallest.ai/api/v1"
@@ -90,8 +90,15 @@ def chunk_text(text: str, chunk_size: int = 250) -> List[str]:
90
90
  return chunks
91
91
 
92
92
 
93
- def get_smallest_languages() -> List[str]:
94
- return TTSLanguages
93
+ def get_smallest_languages(model: str = 'lightning') -> List[str]:
94
+ if model == 'lightning':
95
+ return TTSLanguages_lightning
96
+ elif model == 'lightning-large':
97
+ return TTSLanguages_lightning_large
98
+ elif model == 'lightning-v2':
99
+ return TTSLanguages_lightning_v2
100
+ else:
101
+ raise ValidationError(f"Invalid model: {model}. Must be one of {TTSModels}")
95
102
 
96
103
  def get_smallest_models() -> List[str]:
97
104
  return TTSModels
@@ -66,9 +66,9 @@ class WavesClient:
66
66
  )
67
67
 
68
68
 
69
- def get_languages(self) -> List[str]:
69
+ def get_languages(self, model:str="lightning") -> List[str]:
70
70
  """Returns a list of available languages."""
71
- return get_smallest_languages()
71
+ return get_smallest_languages(model)
72
72
 
73
73
  def get_cloned_voices(self) -> str:
74
74
  """Returns a list of your cloned voices."""
@@ -144,7 +144,7 @@ class WavesClient:
144
144
  validate_input(text, opts.model, opts.sample_rate, opts.speed, opts.consistency, opts.similarity, opts.enhancement)
145
145
 
146
146
  self.chunk_size = 250
147
- if opts.model == "lightning-large":
147
+ if opts.model == "lightning-large" or opts.model == "lightning-v2":
148
148
  self.chunk_size = 140
149
149
 
150
150
  chunks = chunk_text(text, self.chunk_size)
@@ -159,7 +159,7 @@ class WavesClient:
159
159
  "speed": opts.speed,
160
160
  }
161
161
 
162
- if opts.model == "lightning-large":
162
+ if opts.model == "lightning-large" or opts.model == "lightning-v2":
163
163
  if opts.consistency is not None:
164
164
  payload["consistency"] = opts.consistency
165
165
  if opts.similarity is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smallestai
3
- Version: 3.0.2
3
+ Version: 3.1.0
4
4
  Summary: Official Python client for the Smallest AI API
5
5
  Author-email: Smallest <support@smallest.ai>
6
6
  License: MIT
@@ -74,14 +74,14 @@ smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of.py,
74
74
  smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of1.py,sha256=9AJxgngoNSMvDbceajIqnG23PY4rw84coTh7yUTNS3c,3487
75
75
  smallestai/atoms/models/upload_text_to_knowledge_base_request.py,sha256=Sxg0vRv_naT15odE8fBUeyjwLpEYOmQwGcJuzRRr90A,2587
76
76
  smallestai/waves/__init__.py,sha256=Hkq7N2nuz_wS7pC6QeUnIU1MzQnX_nrhfXGpjGSvFhQ,244
77
- smallestai/waves/async_waves_client.py,sha256=hv9rQ8-ykWuHoAcmZPhwtX_-AAQT4H4G3H8c4BhO5-0,12658
77
+ smallestai/waves/async_waves_client.py,sha256=sZrBnH_oi3wumL-w_2ccn1MZkLz7eYOyUFZEwjC-2vY,12746
78
78
  smallestai/waves/exceptions.py,sha256=nY6I8fCXe2By54CytQ0-i3hFiYtt8TYAKj0g6OYsCjc,585
79
- smallestai/waves/models.py,sha256=g2e_4nU5P48vyXZandKLWqZC1TkoEGeLvYKqJIqurSI,83
79
+ smallestai/waves/models.py,sha256=FaMVkOFyNCVpWvyMCmqkv3t1wmnfCs1HIULxLr1L8XE,283
80
80
  smallestai/waves/stream_tts.py,sha256=Ppjwp1jXpUSpyNkwCnesMYQbAdyzKLMj_1o1iTb3jaA,10958
81
- smallestai/waves/utils.py,sha256=0VqMA4apJ-9U7abOznVXqUYEEAxQ2JkpLGyFhcJ_Kbw,3307
82
- smallestai/waves/waves_client.py,sha256=XKdPVWs-HZDzlxzF1x3cMdJQ_q71ZFS1P5oltzj2KO4,10740
83
- smallestai-3.0.2.dist-info/licenses/LICENSE,sha256=kK3HNKhN7luQhkjkNWIvy9_gizbEDUM4mSv_HWq9uuM,1068
84
- smallestai-3.0.2.dist-info/METADATA,sha256=w5DR17sxy9oTxYum6ktWRfo3hktGb6Dx2kP1w_k7bFE,20392
85
- smallestai-3.0.2.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
86
- smallestai-3.0.2.dist-info/top_level.txt,sha256=pdJzm1VC2J6RxoobATz45L9U3cki4AFLigsfvETz7Io,11
87
- smallestai-3.0.2.dist-info/RECORD,,
81
+ smallestai/waves/utils.py,sha256=UPThOnh1O5_6nZ9ZBJoY--iDOnFKBP9Nq3qGHhuDPbc,3692
82
+ smallestai/waves/waves_client.py,sha256=KMUpWolrKqEP24DTRkNzHWpYuWxO3buVpX1cHn90gGY,10832
83
+ smallestai-3.1.0.dist-info/licenses/LICENSE,sha256=kK3HNKhN7luQhkjkNWIvy9_gizbEDUM4mSv_HWq9uuM,1068
84
+ smallestai-3.1.0.dist-info/METADATA,sha256=Gs-xjdLWK7ihF3JH98PpZd4afswx-6Qj7BT3IxUyHoA,20392
85
+ smallestai-3.1.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
86
+ smallestai-3.1.0.dist-info/top_level.txt,sha256=pdJzm1VC2J6RxoobATz45L9U3cki4AFLigsfvETz7Io,11
87
+ smallestai-3.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5