-
Notifications
You must be signed in to change notification settings - Fork 1
Speechtext #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speechtext #15
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add url for slashml
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 ): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
issues addressed:
issue #14
issue #7
issue #6
issue #11
issue #13