dominic-fischer commited on
Commit
2c41b42
·
1 Parent(s): b5b2433

try and fix image rendering

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +7 -3
README.md CHANGED
@@ -21,7 +21,7 @@ Provided a Romansh text, the lemmatizer splits it into words and looks up each w
21
 
22
  For example, if a Romansh text contains the word _lavuraiva_, the lemmatizer traces the word back to the Vallader and Puter dictionaries:
23
 
24
- ![illustration](https://huggingface.co/spaces/ZurichNLP/rumlem/resolve/main/illustration.png)
25
 
26
  Typical use cases for the lemmatizer include:
27
 
 
21
 
22
  For example, if a Romansh text contains the word _lavuraiva_, the lemmatizer traces the word back to the Vallader and Puter dictionaries:
23
 
24
+ IMAGE_PLACEHOLDER
25
 
26
  Typical use cases for the lemmatizer include:
27
 
app.py CHANGED
@@ -19,7 +19,6 @@ def load_readme():
19
 
20
  # Strip YAML frontmatter (content between --- markers)
21
  if content.startswith("---"):
22
- # Find the second occurrence of ---
23
  lines = content.split("\n")
24
  frontmatter_end = None
25
  for index, line in enumerate(lines[1:], start=1):
@@ -28,13 +27,16 @@ def load_readme():
28
  break
29
 
30
  if frontmatter_end is not None:
31
- # Return content after frontmatter, skipping the blank line if present
32
  content = "\n".join(lines[frontmatter_end + 1:]).lstrip("\n")
33
 
34
  return content
35
 
 
 
36
 
37
  readme_content = load_readme()
 
 
38
 
39
  if gr.NO_RELOAD:
40
  lemmatizer = Lemmatizer(learned_et=False)
@@ -250,7 +252,9 @@ with gr.Blocks(
250
  )
251
 
252
  with gr.Accordion("About This Demo", open=False):
253
- gr.Markdown(readme_content)
 
 
254
 
255
  # === Top Row: Input & Chart ===
256
  with gr.Row():
 
19
 
20
  # Strip YAML frontmatter (content between --- markers)
21
  if content.startswith("---"):
 
22
  lines = content.split("\n")
23
  frontmatter_end = None
24
  for index, line in enumerate(lines[1:], start=1):
 
27
  break
28
 
29
  if frontmatter_end is not None:
 
30
  content = "\n".join(lines[frontmatter_end + 1:]).lstrip("\n")
31
 
32
  return content
33
 
34
+ IMAGE_URL = "https://huggingface.co/spaces/ZurichNLP/rumlem/resolve/main/illustration.png"
35
+ IMAGE_PLACEHOLDER = "IMAGE_PLACEHOLDER"
36
 
37
  readme_content = load_readme()
38
+ readme_before_image, readme_after_image = readme_content.split(IMAGE_PLACEHOLDER, 1)
39
+
40
 
41
  if gr.NO_RELOAD:
42
  lemmatizer = Lemmatizer(learned_et=False)
 
252
  )
253
 
254
  with gr.Accordion("About This Demo", open=False):
255
+ gr.Markdown(readme_before_image)
256
+ gr.Image(IMAGE_URL, width=400, show_label=False, show_download_button=False)
257
+ gr.Markdown(readme_after_image)
258
 
259
  # === Top Row: Input & Chart ===
260
  with gr.Row():