class_docstr: Test emEeddingManager for loading embedding files and computing embeddings from waveforms
class_docstr_tok: ["Test","emEeddingManager","for","loading","embedding","files","and","computing","embeddings","from","waveforms"]
code: def test_embedding_file_loading(self):
      # test loading a json file
      manager = EmbeddingManager(
          embedding_file_path=embedding_file_path
      )
      self.assertEqual(manager.num_embeddings, 384)
      self.assertEqual(manager.embedding_dim, 256)
      # test loading a pth file
      manager = EmbeddingManager(
          embedding_file_path=embeddings_file_pth_path
      )
      self.assertEqual(manager.num_embeddings, 384)
      self.assertEqual(manager.embedding_dim, 256)
      # test loading a pth files with duplicate embedding keys
      with self.assertRaises(Exception) as context:
          manager = EmbeddingManager(
              embedding_file_path=[
                  embeddings_file_pth_path,
                  embeddings_file_pth_path,
              ]
          )
      self.assertTrue(
          "Duplicate embedding names" in str(context.exception)
      )
      # test loading embedding files with different embedding keys
      manager = EmbeddingManager(
          embedding_file_path=[
              embeddings_file_pth_path,
              embeddings_file_path2,
          ]
      )
      self.assertEqual(manager.embedding_dim, 256)
      self.assertEqual(manager.num_embeddings, 384 * 2)
  
file_path: TTS/tests/aux_tests/test_embedding_manager.py
imports: import os
  import unittest
  import numpy
  import torch
  from trainer.io import save_checkpoint
  from tests import get_tests_input_path
  from TTS.config import load_config
  from TTS.encoder.utils.generic_utils import setup_encoder_model
  from TTS.tts.utils.managers import EmbeddingManager
  from TTS.utils.audio import AudioProcessor
label_desc: Use image node_id 3 for calling the EmbeddingManagerTest obj's underlying member method code with example usage: obj.test_embedding_file_loading() without return types