Update load_llms.py
Browse files- load_llms.py +7 -8
load_llms.py
CHANGED
@@ -36,20 +36,19 @@ def replace_starttags(html_string, replacements):
|
|
36 |
|
37 |
def format_html_string(html_string):
|
38 |
"""Format the HTML string to a readable text format."""
|
39 |
-
|
40 |
-
|
41 |
-
"a href='https://llama.meta.com/llama3/license/'"
|
42 |
-
"a"]
|
43 |
-
html_string = remove_endtags(html_string, tags_to_remove)
|
44 |
|
45 |
-
|
46 |
"<ul>": "",
|
47 |
"<li>": "\n➤ ",
|
48 |
"<br>": "\n",
|
49 |
"<strong>": "",
|
50 |
-
"<a href='https://opensource.org/license/mit>": "",
|
|
|
|
|
51 |
}
|
52 |
-
formatted_string = replace_starttags(html_string,
|
53 |
|
54 |
return formatted_string
|
55 |
|
|
|
36 |
|
37 |
def format_html_string(html_string):
|
38 |
"""Format the HTML string to a readable text format."""
|
39 |
+
endtags_to_remove = ["ul", "li", "br", "strong", "a"]
|
40 |
+
html_string = remove_endtags(html_string, endtags_to_remove)
|
|
|
|
|
|
|
41 |
|
42 |
+
starttag_replacements = {
|
43 |
"<ul>": "",
|
44 |
"<li>": "\n➤ ",
|
45 |
"<br>": "\n",
|
46 |
"<strong>": "",
|
47 |
+
"<a href='https://opensource.org/license/mit'>": "",
|
48 |
+
"<a href='https://llama.meta.com/llama3/license/'>": "",
|
49 |
+
"<a href='https://atlas.nomic.ai/'>": "",
|
50 |
}
|
51 |
+
formatted_string = replace_starttags(html_string, starttag_replacements)
|
52 |
|
53 |
return formatted_string
|
54 |
|