FoodDesert commited on
Commit
41d10ff
·
verified ·
1 Parent(s): db91c69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
app.py CHANGED
@@ -696,17 +696,12 @@ with gr.Blocks(css=css) as app:
696
  #bad_tags_illustrated_string = gr.HighlightedText(show_legend=True, color_map={"Unknown Tag":"red","Duplicate":"yellow","Remove Final Comma":"purple","Move Comma Inside Parentheses":"green"}, label="Annotated Prompt")
697
  bad_tags_illustrated_string = gr.HTML()
698
  with gr.Column(scale=1):
699
- #image_path = os.path.join("https://huggingface.co/spaces/FoodDesert/Prompt_Squirrel/resolve/main", "transparentsquirrel.png")
700
- #gr.Image(label=" ", value=image_path, height=155, width=140)
701
- gr.HTML('<div style="text-align: center;"><img src="https://huggingface.co/spaces/FoodDesert/Prompt_Squirrel/resolve/main/mascotimages/transparentsquirrel.png" alt="Cute Mascot" style="height: 200px; width: auto; background: transparent;"></div><br>')
702
- #gr.HTML("<br>" * 2) # Adjust the number of line breaks ("<br>") as needed to push the button down
703
- #image_path = os.path.join('mascotimages', "transparentsquirrel.png")
704
- #random_image_path = os.path.join('mascotimages', random.choice([f for f in os.listdir('mascotimages') if os.path.isfile(os.path.join('mascotimages', f))]))
705
- #with Image.open(random_image_path) as img:
706
- # gr.Image(value=img,show_label=False, show_download_button=False, show_share_button=False, height=200)
707
- #gr.Image(value="https://huggingface.co/spaces/FoodDesert/Prompt_Squirrel/resolve/main/mascotimages/transparentsquirrel.png",show_label=False, show_download_button=False, show_share_button=False, height=200)
708
- #I posted the image to discord, and that's where this link came from. This is a very ugly way to do this, but I could not, no matter what I tried, get it to display an image from within the space itself. The galleries work fine for some reason, but not this.
709
- #gr.Image(value="https://res.cloudinary.com/dnse84ol6/image/upload/v1713538125/transparentsquirrel_zhou7f.png",show_label=False, show_download_button=False, show_share_button=False, height=200)
710
  submit_button = gr.Button(variant="primary")
711
  with gr.Row():
712
  with gr.Column(scale=3):
@@ -740,4 +735,4 @@ with gr.Blocks(css=css) as app:
740
 
741
  gr.Markdown(faq_content)
742
 
743
- app.launch()
 
696
  #bad_tags_illustrated_string = gr.HighlightedText(show_legend=True, color_map={"Unknown Tag":"red","Duplicate":"yellow","Remove Final Comma":"purple","Move Comma Inside Parentheses":"green"}, label="Annotated Prompt")
697
  bad_tags_illustrated_string = gr.HTML()
698
  with gr.Column(scale=1):
699
+ gr.HTML(
700
+ '<div style="text-align:center;">'
701
+ '<img src="/file=mascotimages/transparentsquirrel.png" '
702
+ 'alt="Cute Mascot" style="height:220px;width:auto;">'
703
+ '</div>'
704
+ )
 
 
 
 
 
705
  submit_button = gr.Button(variant="primary")
706
  with gr.Row():
707
  with gr.Column(scale=3):
 
735
 
736
  gr.Markdown(faq_content)
737
 
738
+ app.queue().launch(allowed_paths=["mascotimages"])