Spaces:
Build error
Build error
tlemagueresse
commited on
Commit
·
d0df5e4
1
Parent(s):
d856028
drop the header
Browse files
app.py
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
with open("README.md", "r", encoding="utf-8") as f:
|
| 5 |
readme_content = f.read()
|
| 6 |
|
| 7 |
-
|
| 8 |
-
def show_readme():
|
| 9 |
-
return readme_content
|
| 10 |
|
| 11 |
app = gr.Blocks()
|
| 12 |
with app:
|
| 13 |
-
gr.Markdown(
|
| 14 |
|
| 15 |
app.launch()
|
|
|
|
| 1 |
+
import re
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
|
| 5 |
+
def remove_yaml_header(text):
|
| 6 |
+
"""Remove YAML header (front matter) from markdown text."""
|
| 7 |
+
|
| 8 |
+
pattern = r'^---\n[\s\S]*?\n---\n'
|
| 9 |
+
cleaned_text = re.sub(pattern, '', text)
|
| 10 |
+
return cleaned_text
|
| 11 |
+
|
| 12 |
+
|
| 13 |
with open("README.md", "r", encoding="utf-8") as f:
|
| 14 |
readme_content = f.read()
|
| 15 |
|
| 16 |
+
cleaned_readme = remove_yaml_header(readme_content)
|
|
|
|
|
|
|
| 17 |
|
| 18 |
app = gr.Blocks()
|
| 19 |
with app:
|
| 20 |
+
gr.Markdown(cleaned_readme)
|
| 21 |
|
| 22 |
app.launch()
|