shukdevdatta123 commited on
Commit
4da9612
·
verified ·
1 Parent(s): 6ddcaf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -92,8 +92,12 @@ def check_disarium(number):
92
 
93
  # Function to Generate Fake Data
94
  def generate_fake_data(count=1, include_profile=False):
95
- if count <= 0:
96
- return "Please enter a positive number"
 
 
 
 
97
 
98
  fake = Faker()
99
 
@@ -225,7 +229,7 @@ with gr.Blocks(title="MultiToolBox") as app:
225
  gr.Markdown("### Generate Fake Data")
226
 
227
  with gr.Row():
228
- fake_count = gr.Number(label="Number of entries", value=1, min=1, step=1)
229
  fake_profile = gr.Checkbox(label="Generate detailed profiles")
230
 
231
  fake_btn = gr.Button("Generate")
 
92
 
93
  # Function to Generate Fake Data
94
  def generate_fake_data(count=1, include_profile=False):
95
+ try:
96
+ count = int(count)
97
+ if count <= 0:
98
+ return "Please enter a positive number"
99
+ except (ValueError, TypeError):
100
+ return "Please enter a valid number"
101
 
102
  fake = Faker()
103
 
 
229
  gr.Markdown("### Generate Fake Data")
230
 
231
  with gr.Row():
232
+ fake_count = gr.Number(label="Number of entries", value=1)
233
  fake_profile = gr.Checkbox(label="Generate detailed profiles")
234
 
235
  fake_btn = gr.Button("Generate")