validated passing URI path for assets instead of base64 encoding them
This commit is contained in:
parent
d87b492295
commit
9ec88d9444
@ -120,7 +120,7 @@ def main():
|
|||||||
entries = [
|
entries = [
|
||||||
f'<tr><td>{text}</td>'+
|
f'<tr><td>{text}</td>'+
|
||||||
"".join( [
|
"".join( [
|
||||||
f'<td><audio controls="controls" autobuffer="autobuffer"><source src="{args.audio_path_root + audio if args.audio_path_root else encode(audio)}"/></audio></td>'
|
f'<td><audio controls="controls" autobuffer="autobuffer"><source src="{str(audio).replace(str(args.demo_dir), args.audio_path_root) if args.audio_path_root else encode(audio)}"/></audio></td>'
|
||||||
for audio in audios
|
for audio in audios
|
||||||
] )+
|
] )+
|
||||||
'</tr>'
|
'</tr>'
|
||||||
@ -158,14 +158,17 @@ def main():
|
|||||||
reference = dir / "reference.wav"
|
reference = dir / "reference.wav"
|
||||||
out_path = dir / "out" / "ours.wav"
|
out_path = dir / "out" / "ours.wav"
|
||||||
|
|
||||||
decode_to_file( batch["proms"].to("cuda"), prompt, device="cuda" )
|
|
||||||
decode_to_file( batch["resps"].to("cuda"), reference, device="cuda" )
|
|
||||||
|
|
||||||
samples.append((
|
samples.append((
|
||||||
text,
|
text,
|
||||||
[ prompt, reference, out_path ]
|
[ prompt, reference, out_path ]
|
||||||
))
|
))
|
||||||
|
|
||||||
|
if args.skip_existing and out_path.exists():
|
||||||
|
continue
|
||||||
|
|
||||||
|
decode_to_file( batch["proms"].to("cuda"), prompt, device="cuda" )
|
||||||
|
decode_to_file( batch["resps"].to("cuda"), reference, device="cuda" )
|
||||||
|
|
||||||
tts.inference(
|
tts.inference(
|
||||||
text=text,
|
text=text,
|
||||||
references=[prompt],
|
references=[prompt],
|
||||||
@ -187,7 +190,7 @@ def main():
|
|||||||
samples = [
|
samples = [
|
||||||
f'<tr><td>{text}</td>'+
|
f'<tr><td>{text}</td>'+
|
||||||
"".join( [
|
"".join( [
|
||||||
f'<td><audio controls="controls" autobuffer="autobuffer"><source src="{args.audio_path_root + audio if args.audio_path_root else encode(audio)}"/></audio></td>'
|
f'<td><audio controls="controls" autobuffer="autobuffer"><source src="{str(audio).replace(str(args.demo_dir), args.audio_path_root) if args.audio_path_root else encode(audio)}"/></audio></td>'
|
||||||
for audio in audios
|
for audio in audios
|
||||||
] )+
|
] )+
|
||||||
'</tr>'
|
'</tr>'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user