Skip to content

Commit 910762e

Browse files
authored
Merge pull request #40 from slashml/dev
Dev
2 parents 8094585 + b1456b9 commit 910762e

File tree

8 files changed

+31
-8
lines changed

8 files changed

+31
-8
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
All notable changes to `slashml-python-client` aka `slashml` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## 0.1.0 - 2023-05-13
6+
7+
### Added
8+
- Added deepgram model for SpeechToText service
9+
- Added gcp model for SpeechToText service
10+
11+
### Fixed
12+
- Fixed a bug in examples by replacing verbs with `submit_job`
13+
514
## 0.0.6 - 2023-05-11
615

716
### Changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ If the user preferes using the API calls directly, the documentation is availabl
109109
### Speech-to-text
110110
For transcription, SlashML supports the following service providers:
111111

112-
* [AssemblyAI](https://github.com/AssemblyAI)
112+
* [AssemblyAI](https://www.assemblyai.com/)
113113
* [AWS](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html)
114114
* Whisper ([OpenAI](https://openai.com/blog/whisper/))
115+
* [GOOGLE](https://cloud.google.com/speech-to-text)
116+
* [DEEPGRAM](https://deepgram.com/)
115117

116118
### Summarization
117119
For text summarization, SlashML supports the following service providers:

examples/speech_to_text_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def speech_to_text(audio_filepath, service_provider, api_key):
1212
print(f"file uploaded: {uploaded_file}")
1313

1414
# Submit transcription request
15-
job = model.transcribe(
15+
job = model.submit_job(
1616
uploaded_file["upload_url"], service_provider=service_provider
1717
)
1818

@@ -33,7 +33,7 @@ def speech_to_text(audio_filepath, service_provider, api_key):
3333
# Replace `API_KEY` with your SlasML API token. This example still runs without
3434
# the API token but usage will be limited
3535
API_KEY = None
36-
service_provider = SpeechToText.ServiceProvider.ASSEMBLY
36+
service_provider = SpeechToText.ServiceProvider.DEEPGRAM
3737
audio_filepath = "test.mp3"
3838

3939
# Find all the service providers that we support by running the choices() method

examples/speech_to_text_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Replace `API_KEY` with your SlasML API token. This example still runs without
44
# the API token but usage will be limited
55
API_KEY = None
6-
service_provider = SpeechToText.ServiceProvider.AWS
6+
service_provider = SpeechToText.ServiceProvider.GOOGLE
77
audio_filepath = "test.mp3"
88

99
# Find all the service providers that we support by running the choices() method

examples/summarize_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def summarize(text, service_provider, api_key):
66
model = TextSummarization(api_key=api_key)
77

88
# Submit request
9-
job = model.summarize(text=text, service_provider=service_provider)
9+
job = model.submit_job(text=text, service_provider=service_provider)
1010

1111
assert job.status != "ERROR", f"{job}"
1212
print(f"Job ID: {job.id}")
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from slashml import TextToSpeech
2+
import time
23

34
# Replace `API_KEY` with your SlasML API token. This example still runs without
45
# the API token but usage will be limited
@@ -13,7 +14,15 @@
1314
model = TextToSpeech(api_key=API_KEY)
1415

1516
# Submit request
16-
job = model.speechify(text=input_text, service_provider=service_provider)
17+
job = model.submit_job(text=input_text, service_provider=service_provider)
1718
print(job)
1819

19-
print (f"\nYou can access the audio file here: {job.audio_url}")
20+
# check job status
21+
response = model.status(job.id, service_provider=service_provider)
22+
23+
while response.status == "IN_PROGRESS":
24+
print(f"Response = {response}. Retrying in 30 seconds")
25+
time.sleep(30)
26+
response = model.status(job.id, service_provider=service_provider)
27+
28+
print (f"\nYou can access the audio file here: {response.audio_url}")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def read_req_file(req_type):
1414

1515
setup(
1616
name="slashml",
17-
version="0.0.6",
17+
version="0.1.0",
1818
url="https://slashml.com/",
1919
author="eff-kay",
2020
author_email="faiizan14@gmail.com",

slashml/speech_to_text.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class ServiceProvider(Enum):
99
ASSEMBLY = "assembly"
1010
AWS = "aws"
1111
WHISPER = "whisper"
12+
DEEPGRAM = 'deepgram'
13+
GOOGLE = 'google'
1214

1315
@classmethod
1416
def choices(cls):
@@ -55,6 +57,7 @@ def execute(self, upload_url: str, service_provider: ServiceProvider):
5557
# check job status
5658
response = getTaskStatus(self._base_url, self._headers, job.id, service_provider)
5759

60+
# while response.status == "IN_PROGRESS":
5861
while response.status == "IN_PROGRESS":
5962
time.sleep(5)
6063
response = getTaskStatus(self._base_url, self._headers, job.id, service_provider)

0 commit comments

Comments
 (0)