Update pipeline/test_pipeline.py
Browse files- pipeline/test_pipeline.py +72 -0
pipeline/test_pipeline.py
CHANGED
|
@@ -80,3 +80,75 @@ for i in dataset:
|
|
| 80 |
pprint(prediction)
|
| 81 |
break
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
pprint(prediction)
|
| 81 |
break
|
| 82 |
|
| 83 |
+
print("""### P + S ###""")
|
| 84 |
+
pipe = pipeline(model=model_alias,
|
| 85 |
+
punctuator=True,
|
| 86 |
+
stable_ts=True,
|
| 87 |
+
chunk_length_s=15,
|
| 88 |
+
batch_size=16,
|
| 89 |
+
trust_remote_code=True)
|
| 90 |
+
dataset = load_dataset("kotoba-tech/kotoba-whisper-eval", split="train")
|
| 91 |
+
for i in dataset:
|
| 92 |
+
if i["audio"]["path"] == "long_interview_1.mp3":
|
| 93 |
+
i["audio"]["array"] = i["audio"]["array"][:7938000]
|
| 94 |
+
prediction = pipe(
|
| 95 |
+
i["audio"],
|
| 96 |
+
generate_kwargs={"language": "japanese", "task": "transcribe"}
|
| 97 |
+
)
|
| 98 |
+
pprint(prediction)
|
| 99 |
+
break
|
| 100 |
+
|
| 101 |
+
print("""### P ###""")
|
| 102 |
+
pipe = pipeline(model=model_alias,
|
| 103 |
+
punctuator=True,
|
| 104 |
+
stable_ts=False,
|
| 105 |
+
chunk_length_s=15,
|
| 106 |
+
batch_size=16,
|
| 107 |
+
trust_remote_code=True)
|
| 108 |
+
dataset = load_dataset("kotoba-tech/kotoba-whisper-eval", split="train")
|
| 109 |
+
for i in dataset:
|
| 110 |
+
if i["audio"]["path"] == "long_interview_1.mp3":
|
| 111 |
+
i["audio"]["array"] = i["audio"]["array"][:7938000]
|
| 112 |
+
prediction = pipe(
|
| 113 |
+
i["audio"],
|
| 114 |
+
generate_kwargs={"language": "japanese", "task": "transcribe"}
|
| 115 |
+
)
|
| 116 |
+
pprint(prediction)
|
| 117 |
+
break
|
| 118 |
+
|
| 119 |
+
print("""### S ###""")
|
| 120 |
+
pipe = pipeline(model=model_alias,
|
| 121 |
+
punctuator=False,
|
| 122 |
+
stable_ts=True,
|
| 123 |
+
chunk_length_s=15,
|
| 124 |
+
batch_size=16,
|
| 125 |
+
trust_remote_code=True)
|
| 126 |
+
dataset = load_dataset("kotoba-tech/kotoba-whisper-eval", split="train")
|
| 127 |
+
for i in dataset:
|
| 128 |
+
if i["audio"]["path"] == "long_interview_1.mp3":
|
| 129 |
+
i["audio"]["array"] = i["audio"]["array"][:7938000]
|
| 130 |
+
prediction = pipe(
|
| 131 |
+
i["audio"],
|
| 132 |
+
generate_kwargs={"language": "japanese", "task": "transcribe"}
|
| 133 |
+
)
|
| 134 |
+
pprint(prediction)
|
| 135 |
+
break
|
| 136 |
+
|
| 137 |
+
print("""### RAW ###""")
|
| 138 |
+
pipe = pipeline(model=model_alias,
|
| 139 |
+
punctuator=False,
|
| 140 |
+
stable_ts=False,
|
| 141 |
+
chunk_length_s=15,
|
| 142 |
+
batch_size=16,
|
| 143 |
+
trust_remote_code=True)
|
| 144 |
+
dataset = load_dataset("kotoba-tech/kotoba-whisper-eval", split="train")
|
| 145 |
+
for i in dataset:
|
| 146 |
+
if i["audio"]["path"] == "long_interview_1.mp3":
|
| 147 |
+
i["audio"]["array"] = i["audio"]["array"][:7938000]
|
| 148 |
+
prediction = pipe(
|
| 149 |
+
i["audio"],
|
| 150 |
+
generate_kwargs={"language": "japanese", "task": "transcribe"}
|
| 151 |
+
)
|
| 152 |
+
pprint(prediction)
|
| 153 |
+
break
|
| 154 |
+
|