Skip to content

Commit a0aa112

Browse files
committed
finalize the release
1 parent cc58911 commit a0aa112

File tree

6 files changed

+38
-32
lines changed

6 files changed

+38
-32
lines changed

README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ pip install slashml
1111

1212
# Quickstart
1313

14-
#### Transcribe an audio file
14+
#### Convert text to audio
1515
<!-- write a code snippet in the minimum number of lines -->
1616

1717
```python
18-
from slashml import SpeechToText
18+
from slashml import TextToSpeech
19+
import time
1920

2021
# Initialize model
21-
model = SpeechToText()
22+
model = TextToSpeech()
2223

23-
service_provider = SpeechToText.ServiceProvider.ASSEMBLY
24-
# Submit transcription request
25-
job = model.transcribe(upload_url="https://slashml.s3.ca-central-1.amazonaws.com/c7d38026-3ab4-4a04-ad9e-b6679ab79a87", service_provider=service_provider)
24+
service_provider = TextToSpeech.ServiceProvider.GOOGLE
25+
26+
# Submit speechification request
27+
job = model.speechify(text="To be or not to be, that is the question!", service_provider=service_provider)
2628

2729
assert job.status != "ERROR", f"{job}"
2830
print(f"Job ID: {job.id}")
@@ -35,22 +37,22 @@ while response.status == "IN_PROGRESS":
3537
response = model.status(job.id, service_provider=service_provider)
3638
print(f"Response = {response}. Retrying in 30 seconds")
3739

38-
return response
40+
print(response)
3941
```
4042

41-
#### Summarize a text input
43+
#### Transcribe an audio file
4244
<!-- write a code snippet in the minimum number of lines -->
4345

4446
```python
45-
from slashml import TextSummarization
47+
from slashml import SpeechToText
48+
import time
4649

4750
# Initialize model
48-
model = TextSummarization()
49-
50-
service_provider = TextSummarization.ServiceProvider.OPENAI
51+
model = SpeechToText()
5152

52-
# Submit summariztion request
53-
job = model.summarize(text="This is my input text that I want to summarize", service_provider=service_provider)
53+
service_provider = SpeechToText.ServiceProvider.WHISPER
54+
# Submit transcription request
55+
job = model.transcribe(upload_url="https://slashml.s3.ca-central-1.amazonaws.com/c7d38026-3ab4-4a04-ad9e-b6679ab79a87", service_provider=service_provider)
5456

5557
assert job.status != "ERROR", f"{job}"
5658
print(f"Job ID: {job.id}")
@@ -59,27 +61,27 @@ print(f"Job ID: {job.id}")
5961
response = model.status(job.id, service_provider=service_provider)
6062

6163
while response.status == "IN_PROGRESS":
62-
time.sleep(30)
64+
time.sleep(5)
6365
response = model.status(job.id, service_provider=service_provider)
64-
print(f"Response = {response}. Retrying in 30 seconds")
66+
print(f"Response = {response}. Retrying in 5 seconds")
6567

66-
return response
68+
print(response)
6769
```
6870

69-
70-
#### Convert text to audio
71+
#### Summarize a text input
7172
<!-- write a code snippet in the minimum number of lines -->
7273

7374
```python
74-
from slashml import TextToSpeech
75+
from slashml import TextSummarization
76+
import time
7577

7678
# Initialize model
77-
model = TextToSpeech()
79+
model = TextSummarization()
7880

79-
service_provider = TextToSpeech.ServiceProvider.GOOGLE
81+
service_provider = TextSummarization.ServiceProvider.OPENAI
8082

81-
# Submit speechification request
82-
job = model.speechify(text="To be or not to be, that is the question!", service_provider=service_provider)
83+
# Submit summariztion request
84+
job = model.summarize(text="There are of course kinds of thinking that can be done without writing. If you don't need to go too deeply into a problem, you can solve it without writing. If you're thinking about how two pieces of machinery should fit together, writing about it probably won't help much. And when a problem can be described formally, you can sometimes solve it in your head. But if you need to solve a complicated, ill-defined problem, it will almost always help to write about it. Which in turn means that someone who's not good at writing will almost always be at a disadvantage in solving such problems.", service_provider=service_provider)
8385

8486
assert job.status != "ERROR", f"{job}"
8587
print(f"Job ID: {job.id}")
@@ -88,13 +90,16 @@ print(f"Job ID: {job.id}")
8890
response = model.status(job.id, service_provider=service_provider)
8991

9092
while response.status == "IN_PROGRESS":
91-
time.sleep(30)
93+
time.sleep(5)
9294
response = model.status(job.id, service_provider=service_provider)
93-
print(f"Response = {response}. Retrying in 30 seconds")
95+
print(f"Response = {response}. Retrying in 5 seconds")
9496

95-
return response
97+
print(response)
9698
```
9799

100+
101+
102+
98103
### View the list of service providers available
99104

100105
```python

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ def read_req_file(req_type):
1111

1212
setup(
1313
name="slashml",
14-
version="0.1.1",
14+
version="0.0.4",
1515
url="https://slashml.com/",
1616
author="eff-kay",
1717
author_email="faiizan14@gmail.com",
1818
description=(
1919
"A Python client for interacting with SlashML services" "Developed by SlashML."
2020
),
21-
packages=find_packages("slashml"),
21+
packages=find_packages("."),
22+
package_dir={"": "."},
2223
install_requires=read_req_file("install"),
2324
license="MIT",
2425
python_requires=">=3.6",

slashml/speech_to_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import requests
22
from enum import Enum
3-
from .utils.common import generateURL, baseUrl, generateHeaders, formatResponse, getTaskStatus
3+
from .utils import generateURL, baseUrl, generateHeaders, formatResponse, getTaskStatus
44

55

66
class SpeechToText:

slashml/text_summarization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import requests
22
from enum import Enum
3-
from .utils.common import generateURL, baseUrl, generateHeaders, formatResponse, getTaskStatus
3+
from .utils import generateURL, baseUrl, generateHeaders, formatResponse, getTaskStatus
44

55
class TextSummarization:
66
class ServiceProvider(Enum):

slashml/text_to_speech.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import requests
22
from enum import Enum
3-
from .utils.common import generateURL, baseUrl, generateHeaders, formatResponse, getTaskStatus
3+
from .utils import generateURL, baseUrl, generateHeaders, formatResponse, getTaskStatus
44

55

66
class TextToSpeech:

0 commit comments

Comments
 (0)