Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def file_hash(path: str) -> str:
|
|
35 |
return hashlib.md5(f.read()).hexdigest()
|
36 |
|
37 |
def clean_response(text: str) -> str:
|
38 |
-
text = text.encode("utf-
|
39 |
text = re.sub(r"\[.*?\]|\bNone\b", "", text, flags=re.DOTALL)
|
40 |
text = re.sub(r"\n{3,}", "\n\n", text)
|
41 |
text = re.sub(r"[^\n#\-\*\w\s\.,:\(\)]+", "", text)
|
@@ -151,5 +151,5 @@ if __name__ == "__main__":
|
|
151 |
server_port=7860,
|
152 |
show_error=True,
|
153 |
allowed_paths=[report_dir],
|
154 |
-
share=
|
155 |
-
)
|
|
|
35 |
return hashlib.md5(f.read()).hexdigest()
|
36 |
|
37 |
def clean_response(text: str) -> str:
|
38 |
+
text = text.encode("utf-16", "surrogatepass").decode("utf-16", "ignore")
|
39 |
text = re.sub(r"\[.*?\]|\bNone\b", "", text, flags=re.DOTALL)
|
40 |
text = re.sub(r"\n{3,}", "\n\n", text)
|
41 |
text = re.sub(r"[^\n#\-\*\w\s\.,:\(\)]+", "", text)
|
|
|
151 |
server_port=7860,
|
152 |
show_error=True,
|
153 |
allowed_paths=[report_dir],
|
154 |
+
share=True
|
155 |
+
)
|