Skip to content

Commit e52f891

Browse files
committed
update changelog
1 parent 3355944 commit e52f891

File tree

9 files changed

+33
-26
lines changed

9 files changed

+33
-26
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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.6 - 2023-12-21
6+
7+
### Added
8+
- Pin some dependencies
9+
- Add a requirements flag for model deployment
10+
11+
512
## 0.1.5 - 2023-09-17
613

714
### Added
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":2,"languages":{"python-python3-poetry":{"specfileHash":"e466d5cdb4f0114138d43eb6b027fe33","lockfileHash":"f8a716e5ffc6e8184f35537de7eaa860"}}}

examples/deploy_custom_models/scikit-learn/deploy_scikit_learn_models.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,9 @@
1616
# deploy model
1717
response = client.deploy(model_name='sk-learn-model', model=my_model)
1818

19-
# wait for it to be deployed
20-
time.sleep(2)
19+
# check status
2120
status = client.status(model_version_id=response.id)
2221

23-
while status.status != 'READY':
24-
print(f'status: {status.status}')
25-
print('trying again in 5 seconds')
26-
time.sleep(5)
27-
status = client.status(model_version_id=response.id)
28-
29-
if status.status == 'FAILED':
30-
raise Exception('Model deployment failed')
31-
3222
# submit prediction
3323
model_input = [[0, 0, 0, 0]]
3424
prediction = client.predict(model_version_id=response.id, model_input=model_input)

examples/deploy_custom_models/scikit-learn/my_model/model/model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ def predict(self, model_input: Any) -> Any:
3333
model_input
3434
).tolist()
3535
return model_output
36+
37+
38+
Model().predict(input)
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from slashml import SpeechToText, TextSummarization, TextToSpeech
1+
from slashml import SpeechToText, TextSummarization, TextToSpeech, ModelDeployment as Pipeline
22

33
# Replace `API_KEY` with your SlasML API token. This example still runs without
44
# the API token but usage will be limited
@@ -16,22 +16,28 @@
1616
transcribe = SpeechToText(api_key=API_KEY)
1717
summarize = TextSummarization(api_key=API_KEY)
1818
speechify = TextToSpeech(api_key=API_KEY)
19+
pipeline = Pipeline(api=API_KEY)
1920

2021

21-
response = transcribe.execute(
22-
upload_url=uploaded_url, service_provider=service_provider_speech_to_text
23-
)
22+
response = pipeline.deploy(blueprint = [transcribe, summarize, speechify], upload_url=uploaded_url)
23+
24+
pipeline.status(response.pipeline_id)
25+
26+
27+
# response = transcribe.execute(
28+
# upload_url=uploaded_url, service_provider=service_provider_speech_to_text
29+
# )
2430

25-
print('starting pipeline, the first response might take 10 secs')
26-
transcribed_text = response.transcription_data.transcription
27-
print (f"Transcribed Text = {transcribed_text}")
31+
# print('starting pipeline, the first response might take 10 secs')
32+
# transcribed_text = response.transcription_data.transcription
33+
# print (f"Transcribed Text = {transcribed_text}")
2834

29-
response_summarize = summarize.execute(transcribed_text, service_provider_summarize)
35+
# response_summarize = summarize.execute(transcribed_text, service_provider_summarize)
3036

31-
summary = response_summarize.summarization_data
37+
# summary = response_summarize.summarization_data
3238

33-
print (f"Summarized Text = {summary}")
39+
# print (f"Summarized Text = {summary}")
3440

35-
response = speechify.execute(summary, service_provider_text_to_speech)
41+
# response = speechify.execute(summary, service_provider_text_to_speech)
3642

37-
print (f"\n\n\n You can access the audio file here: {response.audio_url}")
43+
# print (f"\n\n\n You can access the audio file here: {response.audio_url}")

requires-install.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
requests
22
addict
3-
truss
3+
truss==0.4.8

setup.py

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

1919
setup(
2020
name="slashml",
21-
version="0.1.5",
21+
version="0.1.6",
2222
url="https://slashml.com/",
2323
author="eff-kay",
2424
author_email="faiizan14@gmail.com",

slashml/model_deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def deploy(self, *, model_name:str, model: str, requirements:t.Optional[list] =
3535

3636
requirements_file_path = 'requirements.txt'
3737

38-
truss.create(model, 'my_model')
38+
truss.create(model, 'my_model', requirements_file=requirements_file_path)
3939
self.create_tar_gz(folder_path='my_model', tar_gz_filename='my_model.tar.gz')
4040

4141
url = generateURL(self._base_url, "models")

test/model_package.pt

-4.58 MB
Binary file not shown.

0 commit comments

Comments
 (0)