Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,15 +26,15 @@ def load_data(input_file):
|
|
| 26 |
speech = librosa.resample(speech, sample_rate,16000)
|
| 27 |
return speech
|
| 28 |
|
| 29 |
-
def write_to_file(input_file):
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
operations = [
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
]
|
| 39 |
|
| 40 |
|
|
@@ -51,9 +51,9 @@ operations = [
|
|
| 51 |
|
| 52 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
| 53 |
|
| 54 |
-
def asr_transcript(
|
| 55 |
-
audio = "Shubham09/whisper31filescheck/repo/my_Audio_file.flac"
|
| 56 |
-
text = pipe(
|
| 57 |
return text
|
| 58 |
|
| 59 |
# speech = load_data(input_file)
|
|
|
|
| 26 |
speech = librosa.resample(speech, sample_rate,16000)
|
| 27 |
return speech
|
| 28 |
|
| 29 |
+
# def write_to_file(input_file):
|
| 30 |
+
# fs = 16000
|
| 31 |
+
# sf.write("my_Audio_file.flac",input_file, fs)
|
| 32 |
+
# api = HfApi()
|
| 33 |
+
# operations = [
|
| 34 |
+
# CommitOperationAdd(path_in_repo="my_Audio_file.flac", path_or_fileobj="Shubham09/whisper31filescheck/repo/my_Audio_file.flac"),
|
| 35 |
+
# # CommitOperationAdd(path_in_repo="weights.h5", path_or_fileobj="~/repo/weights-final.h5"),
|
| 36 |
+
# # CommitOperationDelete(path_in_repo="old-weights.h5"),
|
| 37 |
+
# # CommitOperationDelete(path_in_repo="logs/"),
|
| 38 |
]
|
| 39 |
|
| 40 |
|
|
|
|
| 51 |
|
| 52 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
| 53 |
|
| 54 |
+
def asr_transcript(input_file):
|
| 55 |
+
#audio = "Shubham09/whisper31filescheck/repo/my_Audio_file.flac"
|
| 56 |
+
text = pipe(input_file)["text"]
|
| 57 |
return text
|
| 58 |
|
| 59 |
# speech = load_data(input_file)
|