Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -51,11 +51,11 @@ def noadd_random_noise(prompt, noise_level=0.00):
|
|
51 |
num_noise_chars = int(len(prompt) * (percentage_noise/100))
|
52 |
noise_indices = random.sample(range(len(prompt)), num_noise_chars)
|
53 |
prompt_list = list(prompt)
|
54 |
-
noise_chars = list(string.ascii_letters + string.punctuation + '
|
55 |
-
noise_chars.extend(['
|
56 |
for index in noise_indices:
|
57 |
prompt_list[index] = random.choice(noise_chars)
|
58 |
-
return ""
|
59 |
|
60 |
def send_it1(inputs, noise_level, proc1=proc1):
|
61 |
prompt_with_noise = noadd_random_noise(inputs, noise_level)
|
|
|
51 |
num_noise_chars = int(len(prompt) * (percentage_noise/100))
|
52 |
noise_indices = random.sample(range(len(prompt)), num_noise_chars)
|
53 |
prompt_list = list(prompt)
|
54 |
+
noise_chars = list(string.ascii_letters + string.punctuation + '' + string.digits)
|
55 |
+
noise_chars.extend([''])
|
56 |
for index in noise_indices:
|
57 |
prompt_list[index] = random.choice(noise_chars)
|
58 |
+
return "".join(prompt_list)
|
59 |
|
60 |
def send_it1(inputs, noise_level, proc1=proc1):
|
61 |
prompt_with_noise = noadd_random_noise(inputs, noise_level)
|