Spaces:
Runtime error
Runtime error
Commit
·
75ca4f8
1
Parent(s):
d1732b1
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,8 +34,9 @@ def add_random_noise(prompt, noise_level=0.07):
|
|
| 34 |
noise_indices = random.sample(range(len(prompt)), num_noise_chars)
|
| 35 |
# Add noise to the selected characters
|
| 36 |
prompt_list = list(prompt)
|
|
|
|
| 37 |
for index in noise_indices:
|
| 38 |
-
prompt_list[index] = random.choice(
|
| 39 |
return "".join(prompt_list)
|
| 40 |
|
| 41 |
|
|
|
|
| 34 |
noise_indices = random.sample(range(len(prompt)), num_noise_chars)
|
| 35 |
# Add noise to the selected characters
|
| 36 |
prompt_list = list(prompt)
|
| 37 |
+
noise_chars = string.ascii_letters + string.punctuation + ' '
|
| 38 |
for index in noise_indices:
|
| 39 |
+
prompt_list[index] = random.choice(noise_chars)
|
| 40 |
return "".join(prompt_list)
|
| 41 |
|
| 42 |
|