Skip to content

Commit ae8c2d3

Browse files
committed
final changes
1 parent 5ed3485 commit ae8c2d3

File tree

9 files changed

+66
-7
lines changed

9 files changed

+66
-7
lines changed

DEVELOPMENT.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing to this library
2+
3+
4+
In order to contribute you need to install a few things
5+
6+
7+
1. First make sure you have python3 installed. You can check by running the following command in your terminal
8+
9+
```
10+
python3 -m pip install --upgrade pip
11+
```
12+
13+
2. Install the build packages
14+
```
15+
python3 -m pip install --upgrade build
16+
```
17+
18+
3. Then run the following command at the root of the project to build the package
19+
```
20+
SLASHML_DIR='.' python3 -m build
21+
```
22+
23+
The `SLASHML_DIR` will pick the root dir and build the package inside the dist folder in the root.
24+
25+
26+
4. Pushing the package to pypi
27+
28+
```
29+
python3 -m pip install --upgrade twine
30+
python3 -m pip install --upgrade twine
31+
python3 -m twine upload --repository testpypi dist/*
32+
```
33+
34+
Make sure dist only has the newly build package, otherwise the command will try to deploy all of the packages.
35+
36+
The above command will prompt you for a username and a password. You will need developer access to the pypi repo to be able to push the package. Contact @eff-kay for this.
37+
38+
39+
5. Test the package by
40+
41+
```
42+
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple slashml
43+
```
44+
45+
This command will pull the latest from test.pypi.org and the extra-index-url will pull the dependencies from pypi.org. This is because the slashml package depends on other packages that are not on test.pypi.org.
46+
47+
48+

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ print(f"Summary = {response.summarization_data}")
6868
#### Deploy your own Model
6969
<!-- write a code snippet in the minimum number of lines -->
7070

71+
Note: this examples requires the `transformers` and `torch` packages to be installed. You can install them with `pip install transformers torch`
72+
73+
```
74+
pip install transformers torch
75+
```
76+
7177
```python
7278
from slashml import ModelDeployment
7379
import time

examples/deploy_model/deploy_hugging_face_transformer.py renamed to examples/deploy_model/hugging_face_transformer/deploy_hugging_face_transformer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ def train_model():
1111
my_model = train_model()
1212

1313
# Replace `API_KEY` with your SlasML API token.
14-
API_KEY = "YOUR_API_KEY"
15-
16-
model = ModelDeployment(api_key=API_KEY)
14+
model = ModelDeployment(api_key=None)
1715

1816
# deploy model
1917
response = model.deploy(model_name='my_model_3', model=my_model)
@@ -34,3 +32,4 @@ def train_model():
3432
# submit prediction
3533
input_text = 'Steve jobs is the [MASK] of Apple.'
3634
prediction = model.predict(model_version_id=response.id, model_input=input_text)
35+
print(prediction)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
transformers==4.30.0
2+
torch==2.0.1
3+
slashml==0.1.4

examples/deploy_model/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/speech_to_text_sync.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
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 = "YOUR_API_KEY"
6-
service_provider = SpeechToText.ServiceProvider.REV
6+
API_KEY = None
7+
service_provider = SpeechToText.ServiceProvider.WHISPER
78
audio_filepath = "test.mp3"
89

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

examples/summarize_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Replace `API_KEY` with your SlasML API token. This example still runs without
55
# the API token but usage will be limited
6-
API_KEY = "YOUR_API_KEY"
6+
API_KEY = None
77
service_provider = TextSummarization.ServiceProvider.OPENAI
88

99
input_text = """A good writer doesn't just think, and then write down what he thought, as a sort of transcript. A good writer will almost always discover new things in the process of writing. And there is, as far as I know, no substitute for this kind of discovery. Talking about your ideas with other people is a good way to develop them. But even after doing this, you'll find you still discover new things when you sit down to write. There is a kind of thinking that can only be done by writing."""

examples/text_to_speech_sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +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 = "YOUR_API_KEY"
6+
API_KEY = None
67
service_provider = TextToSpeech.ServiceProvider.AWS
78
input_text = "To be or not to be, that is the question!"
89

requires-build.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build==0.10.0
2+
twine==4.0.2
3+

0 commit comments

Comments
 (0)