Spaces:
Running
Running
Better replace of white chars
Browse files- app.py +2 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
import pandas as pd
|
| 5 |
from gradio.themes.utils.sizes import text_md
|
|
@@ -44,7 +45,7 @@ def process_submission(*inputs):
|
|
| 44 |
inputs = dict(zip(SUBMISSION_INPUTS, inputs))
|
| 45 |
for key in inputs:
|
| 46 |
if key in ("team_name", "model_name"):
|
| 47 |
-
inputs[key] =
|
| 48 |
elif key in ("description", "link_to_model"):
|
| 49 |
inputs[key] = inputs[key].strip() # TODO: u "link_to_model" kontrola funkčního URL
|
| 50 |
validate_submission_inputs(**inputs)
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
+
import regex as re
|
| 4 |
import gradio as gr
|
| 5 |
import pandas as pd
|
| 6 |
from gradio.themes.utils.sizes import text_md
|
|
|
|
| 45 |
inputs = dict(zip(SUBMISSION_INPUTS, inputs))
|
| 46 |
for key in inputs:
|
| 47 |
if key in ("team_name", "model_name"):
|
| 48 |
+
inputs[key] = re.sub(r"""\s+""", " ", inputs[key]).strip()
|
| 49 |
elif key in ("description", "link_to_model"):
|
| 50 |
inputs[key] = inputs[key].strip() # TODO: u "link_to_model" kontrola funkčního URL
|
| 51 |
validate_submission_inputs(**inputs)
|
requirements.txt
CHANGED
|
@@ -9,4 +9,5 @@ scipy
|
|
| 9 |
numpy
|
| 10 |
scikit-learn
|
| 11 |
numba
|
| 12 |
-
gradio-modal
|
|
|
|
|
|
| 9 |
numpy
|
| 10 |
scikit-learn
|
| 11 |
numba
|
| 12 |
+
gradio-modal
|
| 13 |
+
regex
|