Giter VIP home page Giter VIP logo

dstack_testing's Introduction

dstack.ai + whisper example

This repo contains a simple test example in processor.py employing dstack.ai for a speech-to-text translation task using a few example videos (in /test_data/input_data).

For the test run here a very small CPU only machine on AWS was used via the following .dstack/profile.yaml template:

profiles:
  - name: small_test
    project: aws_test
    resources:
       memory: 8GB
    default: true

Example overview

The main logic of the processor.py function for a given example video - given below - is to first strip off the audio portion of the file, and then employ whisper via the transformers library for processing.

# create pipeline
pipe = pipeline(model="openai/whisper-base", device_map="auto")

# video name
video_name = video_file.split('/')[-1].split('.')[0]

# Save the audio clip as an MP3 file
audio_file = audio_directory + '/' + video_name + '.mp3'

# extract audio from video
extract_audio(video_file, audio_file)

# process audio
output = pipe(audio_file, chunk_length_s=30)

dstack_testing's People

Contributors

neonwatty avatar

Watchers

 avatar  avatar Andrey Cheptsov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.