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
1616transcribe = SpeechToText (api_key = API_KEY )
1717summarize = TextSummarization (api_key = API_KEY )
1818speechify = 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}")
0 commit comments