Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,11 +16,16 @@ from pydantic import BaseModel, ValidationError
|
|
16 |
from pypdf import PdfReader
|
17 |
from tenacity import retry, retry_if_exception_type
|
18 |
|
|
|
|
|
19 |
def read_readme():
|
20 |
readme_path = Path("README.md")
|
21 |
if readme_path.exists():
|
22 |
with open(readme_path, "r") as file:
|
23 |
-
|
|
|
|
|
|
|
24 |
else:
|
25 |
return "README.md not found. Please check the repository for more information."
|
26 |
|
|
|
16 |
from pypdf import PdfReader
|
17 |
from tenacity import retry, retry_if_exception_type
|
18 |
|
19 |
+
import re
|
20 |
+
|
21 |
def read_readme():
|
22 |
readme_path = Path("README.md")
|
23 |
if readme_path.exists():
|
24 |
with open(readme_path, "r") as file:
|
25 |
+
content = file.read()
|
26 |
+
# Use regex to remove metadata enclosed in -- ... --
|
27 |
+
content = re.sub(r'--.*?--', '', content, flags=re.DOTALL)
|
28 |
+
return content
|
29 |
else:
|
30 |
return "README.md not found. Please check the repository for more information."
|
31 |
|