Skip to content

Conversation

@JJneid
Copy link
Contributor

@JJneid JJneid commented Dec 28, 2022

issues addressed:
issue #14
issue #7
issue #6
issue #11
issue #13

@JJneid JJneid requested a review from eff-kay December 28, 2022 01:06
README.md Outdated
# SLASHML Python client

to be updated to guide users
This is a Python client for SLASHML. It lets you run transcription jobs from your Python code or Jupyter notebook. Do a transcription job with three lines of code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add url for slashml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The readme should be generic, so it doesn't run transcrption jobs. It runs machine learning jobs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you can give an example of how to do transcription as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,21 @@
MIT License
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only license we need should be at the root, so remove all the licenses inside the folders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to push the chnages, the license at src/LICENSE.txt still exists in this PR, we wan't to remove it.

HEADERS:dict = {}
## add the api key to sys path envs
def __init__(self,API_KEY: str = None):
self.API_KEY=None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.API_KEY is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change is not pushed

# print("Auth with environment variable SLASHML_API_KEY")
else:
self.HEADERS=None
print("No Auth, there are certain limites to the usage")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No API key provided, there are limits to the usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

]
response = requests.post(self.SLASHML_UPLOAD_URL,
headers=headers,files=files)
return response.json()["upload_url"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a possibility that you receive 400 or 500 when uploading the file. When that happens the response.json() might not contain upload_url.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added conditions on this, if the response is success get the upload URL.

response = requests.post(self.SLASHML_TRANSCRIPT_URL, headers=headers, data=payload)
# Check the status code of the response
if response.status_code == 200:
return response.json()["id"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is correct, but are you sure you just want to return the ID from transcribe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now yes,

if response.status_code == 200:
return response.json()["id"]

elif response.status_code == 429:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't check for all invidual error codes. Just pass the error to the user as a reponse. Also you want to pass the error msg.

headers=headers,files=files)
return response.json()["upload_url"]

def transcribe(self,upload_url:str, service_provider: str,header=None ):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the output of transcription?

else:
return "UNKNOWN ERROR"

def status(self,job_id:str, service_provider: str ,header=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the output of status?

@@ -0,0 +1,21 @@
import slashml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this file, or convert it into tests

# Initialize SlashML
speect_to_text = slashml.SpeechToText()
# optional local file to upload, if not an accessible url
file_location="/Users/JJneid/Desktop/SlashMl/Benchmarking/podcast1/podcast1_long_trim.mp3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this location is specific to your computer.

[SlashML](https://www.slashml.com/)
# Introduction
## Overview
This is a Python client (SDK) for SlashML. It allows the user to use the apps available and active in [SlashML-Dashboard](https://www.slashml.com/dashboard).
Copy link
Contributor

@eff-kay eff-kay Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we call them endpoints or services, not apps.

# Introduction
## Overview
This is a Python client (SDK) for SlashML. It allows the user to use the apps available and active in [SlashML-Dashboard](https://www.slashml.com/dashboard).
The apps can be together in the same code. For example, if the user wants to transcribe an audio file and get a summary, they can call speechtotext followed by summarization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The apps can be together in the same code. For example, if the user wants to transcribe an audio file and get a summary, they can call speechtotext followed by summarization.
The endpoints can be combined together in any order. For example, if the user wants to transcribe an audio file and get a summary, they can call `speechtotext` followed by summarization.

The apps can be together in the same code. For example, if the user wants to transcribe an audio file and get a summary, they can call speechtotext followed by summarization.

to be updated to guide users
State-of-the-art AI models from several service providers are available. At SlashML, we also do the benchmarking on these models for the user. This will give them an idea of the best service provider for their application. For the full list of the available models thru SlashML, click [here](##availlable-service-providers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thru?

The apps can be together in the same code. For example, if the user wants to transcribe an audio file and get a summary, they can call speechtotext followed by summarization.

to be updated to guide users
State-of-the-art AI models from several service providers are available. At SlashML, we also do the benchmarking on these models for the user. This will give them an idea of the best service provider for their application. For the full list of the available models thru SlashML, click [here](##availlable-service-providers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will give who an idea for the best service provider. The user is reading the email. Write in third person, not second person.




to lets you run transcription jobs from your Python code or Jupyter notebook. The transcription can be done with three lines of code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize to




to lets you run transcription jobs from your Python code or Jupyter notebook. The transcription can be done with three lines of code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first line of this paragraph does not make sense.

speect_to_text = slashml.SpeechToText()
transcribe_id= speect_to_text.transcribe(audio_url,service_provider="aws")
status=speect_to_text.status(transcribe_id,service_provider=service_provider)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will not work, you need to wait for the status to turn to COMPLETED.

```

## Set up and usage
There is a daily limit (throttling) on the number of calls the user performs, the code runs without specifying a token (API key), the throttling kicks in and prevents new jobs after exceeding 10 calls per minute.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There is a daily limit (throttling) on the number of calls the user performs, the code runs without specifying a token (API key), the throttling kicks in and prevents new jobs after exceeding 10 calls per minute.
There is a daily limit (throttling) on the number of calls the user performs. The code can run without specifying a token (API key). However, the throttling will limit job requests that exceed 10 calls per minute.

## Set up and usage
There is a daily limit (throttling) on the number of calls the user performs, the code runs without specifying a token (API key), the throttling kicks in and prevents new jobs after exceeding 10 calls per minute.

If the user intends on using the service more frequently, it is recommended to generate an token or API key from [SlashML-Dashboard](https://www.slashml.com/dashboard). This way, the throttling limit will increase.
Copy link
Contributor

@eff-kay eff-kay Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate a token or an API key


If the user intends on using the service more frequently, it is recommended to generate an token or API key from [SlashML-Dashboard](https://www.slashml.com/dashboard). This way, the throttling limit will increase.

Sign up and Grab your token from [SlashML-Dashboard](https://www.slashml.com/dashboard)>settings> new api key and authenticate by setting it as an environment variable (or when you initialize the service, see Quickstart tutorial):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a new subsection. Also, reword this


In your terminal
```
export SLASHML_API_KEY=[token]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only works for macs and unix, will not work in windows. Specify how to set it in the terminal in different OSes.

```

If the user preferes using the API calls directly, the documentation is available [here](https://www.slashml.com/dashboard).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems a sudden jump, in thought Should be a separate section.

AWS
Whisper (OpenAI)

### Summarization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove summarization from this PR.

hugging-face summarization based on Meta... include links
# Quickstart tutorial

## Introduction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation is not finalized, remove the extra contents.

@eff-kay eff-kay merged commit a25a1cc into main Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants