Repository: explodinggradients/ragas
Issue: `testset_size` Parameter Not Generating Correct Number of Samples
Root cause: Algorithmic Error

[ ] I have checked the [documentation](https://docs.ragas.io/) and related resources and couldn't resolve my bug.

**Describe the bug**
I specified `testset_size=5` in my code when generating a test set using the `TestsetGenerator`, but the resulting dataset contained 7 samples instead of the expected 5.

**Code Used**:

Ragas version:
Python version:

**Code to Reproduce**
```python
from ragas.testset import TestsetGenerator

generator = TestsetGenerator(llm=generator_llm, embedding_model=generator_embeddings)
docs = loader.load()
dataset = generator.generate_with_langchain_docs(docs, testset_size=5)

**Error trace**

**Expected behavior**
The dataset should contain exactly 5 samples.


**Additional context**
Additional Information:

# Initialize the LLM wrapper
generator_llm = LangchainLLMWrapper(ChatOpenAI(model="gpt-4"))

# Initialize the Embeddings wrapper
generator_embeddings = LangchainEmbeddingsWrapper(OpenAIEmbeddings())

Document loader: langchain_community.document_loaders import WebBaseLoader
Number of documents loaded: [10]


<!-- 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 🙏. -->


hey @Jayashree-kalabhavi that is the expected behaviour 🙂 

the ideas was to round up for the distributions so that after you have more testcases to review

I'm closing this now

Thanks @jjmachan 
Is it expected behavior for the same questions to appear in the test set? Additionally, The generated user inputs contain spelling mistakes. Is there something I should do to fix this?  


Attaching the user input for reference.


<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:////Users/jayashreekalabhavi/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip.htm">
<link rel=File-List
href="file:////Users/jayashreekalabhavi/Library/Group%20Containers/UBF8T346G9.Office/TemporaryItems/msohtmlclip/clip_filelist.xml">
<style>
<!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
@page
	{margin:1.0in .75in 1.0in .75in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;}
tr
	{mso-height-source:auto;}
col
	{mso-width-source:auto;}
br
	{mso-data-placement:same-cell;}
td
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:Calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:General;
	text-align:general;
	vertical-align:bottom;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl65
	{color:windowtext;
	font-weight:700;
	text-align:center;
	vertical-align:top;
	border:.5pt solid windowtext;}
-->
</style>
</head>

<body link=blue vlink=purple>


user_input
--
What does the term 'The Site of the   University of Missouri' refer to according to the Board Bylaws?
What is the role of the Presidnet in the   University of Missouri as per the Board of Curators?
Who can call a spesial meting of the   Board?
What are the responsibilities of the   Board of Curators as per the Board Bylaws?
who appoints general counsel?
What are the responsibilities of the   Board of Curators at the University of Missouri?
What are the responsibilities of the   Board of Curators at the University of Missouri?



</body>

</html>