ydshieh commited on
Commit
0bb133b
1 Parent(s): e53a130

move desc to sidebar

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -6,7 +6,7 @@ import numpy as np
6
  # Designing the interface
7
  st.title("🖼️ French Image Caption App")
8
 
9
- st.markdown(
10
  """
11
  An image caption model [ViT-GPT2](https://huggingface.co/flax-community/vit-gpt2/tree/main) by combining the ViT model and a French GPT2 model.
12
  [Part of the [Huggingface JAX/Flax event](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/).]\n
@@ -22,7 +22,7 @@ st.markdown(
22
  with st.spinner('Loading and compiling ViT-GPT2 model ...'):
23
 
24
  from model import *
25
- st.sidebar.write(f'Vit-GPT2 model loaded :)')
26
 
27
  st.sidebar.title("Select a sample image")
28
 
@@ -50,10 +50,7 @@ with st.spinner('Generating image caption ...'):
50
  st.header(f'**English Translation**: {caption_en}')
51
 
52
  st.sidebar.header("ViT-GPT2 predicts:")
53
- st.sidebar.write(f"French: {caption}")
54
- st.sidebar.write(f"English: {caption_en}")
55
-
56
- show = st.sidebar.image(image, use_column_width=True)
57
- show.image(image, use_column_width=True)
58
 
59
  image.close()
 
6
  # Designing the interface
7
  st.title("🖼️ French Image Caption App")
8
 
9
+ st.sidebar.markdown(
10
  """
11
  An image caption model [ViT-GPT2](https://huggingface.co/flax-community/vit-gpt2/tree/main) by combining the ViT model and a French GPT2 model.
12
  [Part of the [Huggingface JAX/Flax event](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/).]\n
 
22
  with st.spinner('Loading and compiling ViT-GPT2 model ...'):
23
 
24
  from model import *
25
+ # st.sidebar.write(f'Vit-GPT2 model loaded :)')
26
 
27
  st.sidebar.title("Select a sample image")
28
 
 
50
  st.header(f'**English Translation**: {caption_en}')
51
 
52
  st.sidebar.header("ViT-GPT2 predicts:")
53
+ st.sidebar.write(f"**French**: {caption}")
54
+ st.sidebar.write(f"**English**: {caption_en}")
 
 
 
55
 
56
  image.close()