Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,16 +43,14 @@ dspy.settings.configure(lm=model)
|
|
| 43 |
# Utils
|
| 44 |
def parse_CSV_string(csv_string):
|
| 45 |
# Parses a CSV string into a list
|
| 46 |
-
if not csv_string:
|
| 47 |
-
return []
|
| 48 |
return list(map(str.strip, csv_string.split(',')))
|
| 49 |
|
| 50 |
|
| 51 |
def parse_CSV_string_to_unique(csv_string):
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
def parse_list_of_CSV_strings(list_of_csv_strings):
|
| 58 |
# Parses a list of CSV strings with invoice numbers into a list of lists
|
|
@@ -138,8 +136,10 @@ def clean_text(s):
|
|
| 138 |
return cleaned_s
|
| 139 |
|
| 140 |
def format_text_decimal(text_decimal):
|
| 141 |
-
|
| 142 |
-
|
|
|
|
|
|
|
| 143 |
|
| 144 |
|
| 145 |
# PDF handling
|
|
|
|
| 43 |
# Utils
|
| 44 |
def parse_CSV_string(csv_string):
|
| 45 |
# Parses a CSV string into a list
|
|
|
|
|
|
|
| 46 |
return list(map(str.strip, csv_string.split(',')))
|
| 47 |
|
| 48 |
|
| 49 |
def parse_CSV_string_to_unique(csv_string):
|
| 50 |
+
# Parses a CSV string into a unique list
|
| 51 |
+
if not csv_string:
|
| 52 |
+
return []
|
| 53 |
+
return list(set(map(str.lower, map(str.strip, csv_string.split(',')))))
|
| 54 |
|
| 55 |
def parse_list_of_CSV_strings(list_of_csv_strings):
|
| 56 |
# Parses a list of CSV strings with invoice numbers into a list of lists
|
|
|
|
| 136 |
return cleaned_s
|
| 137 |
|
| 138 |
def format_text_decimal(text_decimal):
|
| 139 |
+
# Run functions to format a text decimal
|
| 140 |
+
if not text_decimal:
|
| 141 |
+
return ''
|
| 142 |
+
return clean_text(remove_chars_after_last_digit(standardize_number(text_decimal.strip().lower())))
|
| 143 |
|
| 144 |
|
| 145 |
# PDF handling
|