Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files359 unmodified lines36036136236336436526 unmodified lines392393394395396397359 unmodified linesthread_name = threading.current_thread().nameprint(f"Thread {thread_name}: Hash {hash_val}")# Print the hash and thread informationif resample_sr >= 16000 and tgt_sr != resample_sr:tgt_sr = resample_sr26 unmodified linesreturn info, (None, None)def get_vc(sid, to_return_protect0):global n_spk, tgt_sr, net_g, vc, cpt, version, weights_indexif sid == "" or sid == []:359 unmodified lines36036136236336436536636726 unmodified lines394395396397398399400401402403404405406407408409410411412413359 unmodified linesthread_name = threading.current_thread().nameprint(f"Thread {thread_name}: Hash {hash_val}")sample_and_print(audio_opt,thread_name)# Print the hash and thread informationif resample_sr >= 16000 and tgt_sr != resample_sr:tgt_sr = resample_sr26 unmodified linesreturn info, (None, None)def sample_and_print(array, thread_name):# Ensure the array has more than 10 elements; otherwise, use the array lengthnum_samples = 10 if len(array) > 10 else len(array)# Calculate indices to sample; spread them evenly across the arrayindices = np.linspace(0, len(array) - 1, num=num_samples, dtype=int)# Sample elementssampled_elements = array[indices]# Print sampled elements with thread IDprint(f"Thread {thread_name}: Sampled Elements: {sampled_elements}")def get_vc(sid, to_return_protect0):global n_spk, tgt_sr, net_g, vc, cpt, version, weights_indexif sid == "" or sid == []:
myinfer_latest.py+16