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 = [
|
||||
f'<tr><td>{text}</td>'+
|
||||
"".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
|
||||
] )+
|
||||
'</tr>'
|
||||
|
@ -158,14 +158,17 @@ def main():
|
|||
reference = dir / "reference.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((
|
||||
text,
|
||||
[ 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(
|
||||
text=text,
|
||||
references=[prompt],
|
||||
|
@ -187,7 +190,7 @@ def main():
|
|||
samples = [
|
||||
f'<tr><td>{text}</td>'+
|
||||
"".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
|
||||
] )+
|
||||
'</tr>'
|
||||
|
|
Loading…
Reference in New Issue
Block a user