Rename to verbanote
This commit is contained in:
parent
be779f0aca
commit
f76213bace
5 changed files with 19 additions and 2 deletions
0
verbanote/__init__.py
Normal file
0
verbanote/__init__.py
Normal file
18
verbanote/model.py
Normal file
18
verbanote/model.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# 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
|
||||
|
||||
# set up locale
|
||||
import locale
|
||||
locale.getpreferredencoding = lambda: "UTF-8"
|
||||
|
||||
# prepend silent audio to clip
|
||||
from pydub import AudioSegment
|
||||
|
||||
spacermilli = 2000
|
||||
spacer = AudioSegment.silent(duration=spacermilli)
|
||||
|
||||
|
||||
audio = AudioSegment.from_wav("input.wav")
|
||||
|
||||
audio = spacer.append(audio, crossfade=0)
|
||||
|
||||
audio.export('input_prep.wav', format='wav')
|
||||
24
verbanote/notebook.py
Normal file
24
verbanote/notebook.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
## SETTINGS FOR LATER
|
||||
from pathlib import Path
|
||||
|
||||
# @markdown Enter the URL of the YouTube video, or the path to the video/audio file you want to transcribe, give the output path, etc. and run the cell. HTML file embeds the video for YouTube, and audio for media files.
|
||||
|
||||
Source = "Youtube" # @param ['Youtube', 'File (Google Drive)']
|
||||
# @markdown ---
|
||||
# @markdown #### **Youtube video**
|
||||
video_url = "https://youtu.be/hpZFJctBUHQ" # @param {type:"string"}
|
||||
# store_audio = True #@param {type:"boolean"}
|
||||
# @markdown ---
|
||||
# @markdown #### **Google Drive video or audio path (mp4, wav, mp3)**
|
||||
video_path = "/content/drive/MyDrive/Customer_Service.mp3" # @param {type:"string"}
|
||||
# @markdown ---
|
||||
output_path = "/content/transcript/" # @param {type:"string"}
|
||||
output_path = str(Path(output_path))
|
||||
# @markdown ---
|
||||
# @markdown #### **Title for transcription of media file**
|
||||
audio_title = "Sample Order Taking" # @param {type:"string"}
|
||||
# @markdown ---
|
||||
# @markdown #### Copy a token from your [Hugging Face tokens page](https://huggingface.co/settings/tokens) and paste it below.
|
||||
access_token = "hf_" # @param {type:"string"}
|
||||
# @markdown ---
|
||||
# @markdown **Run this cell again if you change the video.**
|
||||
17
verbanote/rp_handler.py
Normal file
17
verbanote/rp_handler.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import runpod
|
||||
|
||||
def is_even(job):
|
||||
job_input = job["input"]
|
||||
num = job_input["number"]
|
||||
|
||||
if not isinstance(num, int):
|
||||
return {"error": "Integer required."}
|
||||
|
||||
if num % 2 == 0:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
runpod.serverless.start({"handler": is_even})
|
||||
Loading…
Add table
Add a link
Reference in a new issue