Repository: explodinggradients/ragas
Issue: testset-generation: Embedding issues in apply_transforms
Root cause: Resource Mishandling

[ ] I have checked the [documentation](https://docs.ragas.io/) and related resources and couldn't resolve my bug.

**Describe the bug**
I'm trying to run the testset-generation example. While running the code form "https://docs.ragas.io/en/stable/getstarted/rag_testset_generation/#testset-generation". The entire process hangs during the embeddings generation. I have tried with also small set of documents. 

Ragas version: 0.2.2
Python version: 3.11.0

**Code to Reproduce**
Share code to reproduce the issue

**Error trace**
100%|██████████| 5/5 [00:06<00:00,  1.27s/it]
Applying Transformations:   0%|          | 0/6 [00:00<?, ?it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:   0%|          | 0/10 [00:00<?, ?it/s]KG Details: Nodes= 0. Relationships: 0
KG Details: Nodes= 5. Relationships: 0
Default Transforms Selected.....

Applying [SummaryExtractor, HeadlinesExtractor]:  10%|█         | 1/10 [00:01<00:17,  1.90s/it]
Applying [SummaryExtractor, HeadlinesExtractor]:  20%|██        | 2/10 [00:02<00:07,  1.05it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  30%|███       | 3/10 [00:03<00:07,  1.10s/it]
Applying [SummaryExtractor, HeadlinesExtractor]:  40%|████      | 4/10 [00:03<00:05,  1.18it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  50%|█████     | 5/10 [00:04<00:03,  1.38it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  70%|███████   | 7/10 [00:05<00:01,  1.89it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  80%|████████  | 8/10 [00:05<00:00,  2.08it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  90%|█████████ | 9/10 [00:07<00:00,  1.06it/s]
Applying [SummaryExtractor, HeadlinesExtractor]: 100%|██████████| 10/10 [00:10<00:00,  1.02s/it]
Applying Transformations:  17%|█▋        | 1/6 [00:10<00:51, 10.25s/it]
Applying EmbeddingExtractor:   0%|          | 0/5 [00:00<?, ?it/s]
Applying EmbeddingExtractor: 100%|██████████| 5/5 [00:02<00:00,  2.02it/s]
Applying Transformations:  33%|███▎      | 2/6 [00:12<00:22,  5.68s/it]
Applying HeadlineSplitter: 100%|██████████| 5/5 [00:00<00:00, 3553.89it/s]

Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   0%|          | 0/117 [00:00<?, ?it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   1%|          | 1/117 [00:00<01:40,  1.15it/s]
**Expected behavior**
A clear and concise description of what you expected to happen.


**Additional context**
Add any other context about the problem here.

<!-- PS: bugs suck but is also part of the process. We sincerely apologies for breaking your flow because of it, but don't worry, we got your back ❤️. We will get this fixed as fast as we can and thanks for helping us out by reporting it 🙏. -->


When I run the same code in debug mode. It works. Looks like the issue might be in the in the `engine.py` script
's `run_coroutines`. Error = `sys:1: RuntimeWarning: coroutine 'Extractor.generate_execution_plan.<locals>.apply_extract' was never awaited`. 


Debug Mode:

 `Connected to pydev debugger (build 233.15026.15)
100%|██████████| 5/5 [00:05<00:00,  1.18s/it]
KG Details: Nodes= 0. Relationships: 0
KG Details: Nodes= 5. Relationships: 0
Default Transforms Selected.....
Applying Transformations:   0%|          | 0/6 [00:00<?, ?it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:   0%|          | 0/10 [00:00<?, ?it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  10%|█         | 1/10 [00:02<00:18,  2.03s/it]
Applying [SummaryExtractor, HeadlinesExtractor]:  20%|██        | 2/10 [00:02<00:10,  1.29s/it]
Applying [SummaryExtractor, HeadlinesExtractor]:  30%|███       | 3/10 [00:03<00:06,  1.11it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  40%|████      | 4/10 [00:03<00:04,  1.25it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  50%|█████     | 5/10 [00:03<00:02,  1.83it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  60%|██████    | 6/10 [00:04<00:01,  2.33it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  70%|███████   | 7/10 [00:04<00:01,  2.40it/s]
Applying [SummaryExtractor, HeadlinesExtractor]:  80%|████████  | 8/10 [00:06<00:01,  1.23it/s]
Applying [SummaryExtractor, HeadlinesExtractor]: 100%|██████████| 10/10 [00:14<00:00,  1.42s/it]
Applying Transformations:  17%|█▋        | 1/6 [00:14<01:11, 14.22s/it]
Applying EmbeddingExtractor:   0%|          | 0/5 [00:00<?, ?it/s]
Applying EmbeddingExtractor: 100%|██████████| 5/5 [00:02<00:00,  1.83it/s]
Applying Transformations:  33%|███▎      | 2/6 [00:16<00:29,  7.46s/it]
Applying HeadlineSplitter: 100%|██████████| 5/5 [00:00<00:00, 1832.05it/s]

Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   0%|          | 0/114 [00:00<?, ?it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   1%|          | 1/114 [00:01<02:27,  1.30s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   4%|▍         | 5/114 [00:02<00:38,  2.85it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   6%|▌         | 7/114 [00:02<00:36,  2.92it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:   7%|▋         | 8/114 [00:03<00:37,  2.84it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  10%|▉         | 11/114 [00:03<00:24,  4.24it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  11%|█▏        | 13/114 [00:04<00:25,  3.93it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  14%|█▍        | 16/114 [00:04<00:19,  5.01it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  16%|█▌        | 18/114 [00:04<00:17,  5.49it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  20%|██        | 23/114 [00:04<00:09,  9.63it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  25%|██▍       | 28/114 [00:05<00:07, 11.40it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  26%|██▋       | 30/114 [00:05<00:09,  8.80it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  28%|██▊       | 32/114 [00:06<00:19,  4.24it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  29%|██▉       | 33/114 [00:07<00:19,  4.19it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  33%|███▎      | 38/114 [00:08<00:19,  3.95it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  37%|███▋      | 42/114 [00:46<04:14,  3.53s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  38%|███▊      | 43/114 [00:46<03:43,  3.15s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  39%|███▊      | 44/114 [00:47<03:21,  2.89s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  40%|████      | 46/114 [00:48<02:28,  2.19s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  46%|████▌     | 52/114 [00:48<01:03,  1.02s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  48%|████▊     | 55/114 [00:49<00:45,  1.31it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  53%|█████▎    | 60/114 [00:49<00:26,  2.06it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  56%|█████▌    | 64/114 [00:49<00:18,  2.72it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  58%|█████▊    | 66/114 [00:51<00:21,  2.26it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  60%|█████▉    | 68/114 [00:51<00:18,  2.52it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  62%|██████▏   | 71/114 [00:54<00:22,  1.87it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  65%|██████▍   | 74/114 [00:54<00:16,  2.46it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  68%|██████▊   | 77/114 [00:55<00:12,  3.03it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  69%|██████▉   | 79/114 [00:55<00:10,  3.47it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  72%|███████▏  | 82/114 [00:55<00:07,  4.31it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  74%|███████▎  | 84/114 [01:07<00:44,  1.49s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  76%|███████▋  | 87/114 [01:07<00:28,  1.06s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  79%|███████▉  | 90/114 [01:07<00:18,  1.33it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  81%|████████  | 92/114 [01:09<00:15,  1.38it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  82%|████████▏ | 94/114 [01:09<00:11,  1.72it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  85%|████████▌ | 97/114 [01:10<00:08,  1.98it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  92%|█████████▏| 105/114 [01:11<00:02,  3.62it/s]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  93%|█████████▎| 106/114 [01:48<00:29,  3.65s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  95%|█████████▍| 108/114 [01:48<00:17,  2.90s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  96%|█████████▌| 109/114 [01:48<00:12,  2.55s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  96%|█████████▋| 110/114 [01:48<00:08,  2.19s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  97%|█████████▋| 111/114 [01:49<00:05,  1.92s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  98%|█████████▊| 112/114 [01:50<00:03,  1.71s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]:  99%|█████████▉| 113/114 [01:50<00:01,  1.38s/it]
Applying [EmbeddingExtractor, KeyphrasesExtractor, TitleExtractor]: 100%|██████████| 114/114 [01:51<00:00,  1.02it/s]
Applying Transformations:  67%|██████▋   | 4/6 [02:08<01:15, 37.89s/it]
Applying CosineSimilarityBuilder: 100%|██████████| 1/1 [00:00<00:00, 176.83it/s]

Applying SummaryCosineSimilarityBuilder: 100%|██████████| 1/1 [00:00<00:00, 734.17it/s]
Applying Transformations: 100%|██████████| 6/6 [02:08<00:00, 21.49s/it]
Transformed KG Details: Nodes= 38. Relationships: 92
Generating Scenarios:   0%|          | 0/3 [00:00<?, ?it/s]
Generating common_concepts:   0%|          | 0/1 [00:00<?, ?it/s]

Generating common themes:   0%|          | 0/1 [00:00<?, ?it/s]

Generating common themes: 100%|██████████| 1/1 [00:01<00:00,  1.53s/it]

Generating Scenarios:  67%|██████▋   | 2/3 [00:01<00:00,  1.30it/s]
Generating common_concepts: 100%|██████████| 1/1 [00:02<00:00,  2.88s/it]
Generating Samples: 100%|██████████| 11/11 [00:05<00:00,  1.87it/s]
Test set Details: 
                                          user_input  ...                     synthesizer_name
0  pitfalls of token-choice routing in MoE models...  ...             AbstractQuerySynthesizer
1  What are the main pitfals of token-choice rout...  ...             AbstractQuerySynthesizer
2  What are pitfalls of token-choice routing in M...  ...             AbstractQuerySynthesizer
3  How do the various Mixture of Experts (MoE) mo...  ...  ComparativeAbstractQuerySynthesizer
4  How do the expert specialization techniques an...  ...  ComparativeAbstractQuerySynthesizer

[5 rows x 4 columns]`