Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,39 @@
|
|
| 1 |
-
import evaluate
|
| 2 |
-
from evaluate.utils import launch_gradio_widget
|
| 3 |
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# import evaluate
|
| 2 |
+
# from evaluate.utils import launch_gradio_widget
|
| 3 |
|
| 4 |
+
# module = evaluate.load("SEA-AI/PanopticQuality")
|
| 5 |
+
# launch_gradio_widget(module)
|
| 6 |
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
import sys
|
| 9 |
+
import gradio as gr
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def read_markdown(filepath):
|
| 13 |
+
with open(filepath, 'r') as file:
|
| 14 |
+
lines = file.readlines()
|
| 15 |
+
start_index = None
|
| 16 |
+
end_index = None
|
| 17 |
+
for i, line in enumerate(lines):
|
| 18 |
+
if line.strip() == '---':
|
| 19 |
+
if start_index is None:
|
| 20 |
+
start_index = i
|
| 21 |
+
else:
|
| 22 |
+
end_index = i
|
| 23 |
+
break
|
| 24 |
+
if end_index is None:
|
| 25 |
+
return ''.join(
|
| 26 |
+
lines) # If no end delimiter found, return entire content
|
| 27 |
+
else:
|
| 28 |
+
return ''.join(lines[end_index +
|
| 29 |
+
1:]) # Return content after end delimiter
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
local_path = Path(sys.path[0])
|
| 33 |
+
filepath = local_path / "README.md"
|
| 34 |
+
markdown_content = read_markdown(filepath)
|
| 35 |
+
|
| 36 |
+
with gr.Blocks() as demo:
|
| 37 |
+
gr.Markdown(markdown_content)
|
| 38 |
+
|
| 39 |
+
demo.launch()
|