Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files359 unmodified lines36036136236336436536636726 unmodified lines394395396397398399400401402403404405406407408409410411412413359 unmodified lines thread_name = threading.current_thread().name print(f"Thread {thread_name}: Hash {hash_val}") sample_and_print(audio_opt,thread_name) # Print the hash and thread information if resample_sr >= 16000 and tgt_sr != resample_sr: tgt_sr = resample_sr26 unmodified lines return info, (None, None)
def sample_and_print(array, thread_name): # Ensure the array has more than 10 elements; otherwise, use the array length num_samples = 10 if len(array) > 10 else len(array) # Calculate indices to sample; spread them evenly across the array indices = np.linspace(0, len(array) - 1, num=num_samples, dtype=int) # Sample elements sampled_elements = array[indices] # Print sampled elements with thread ID print(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_index if sid == "" or sid == []:myinfer_latest.py+16