caveman1 commited on
Commit
bbd4036
·
verified ·
1 Parent(s): c7bf31f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  import gradio as gr
2
  import torch
3
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
@@ -184,9 +189,8 @@ with gr.Blocks(title="Flux Prompt Enhance",
184
  interactive=False, show_fullscreen_button=False,)
185
 
186
  with gr.Row(variant="default"):
187
- gr.HTML("""
188
- <h1>Flux Prompt Enhance portable by <a href='https://boosty.to/aicave/donate' style="color: #4AA0E2;">CaveMan</a></h1>
189
- """)
190
  with gr.Row(variant="default"):
191
  # выбор языка UI
192
  radio_lang = gr.Radio(choices = ["RU", "EN"], show_label = False, container = False, type = "value",
 
1
+ import os
2
+
3
+ def is_running_in_huggingface_spaces():
4
+ return "SPACE_ID" in os.environ
5
+
6
  import gradio as gr
7
  import torch
8
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
 
189
  interactive=False, show_fullscreen_button=False,)
190
 
191
  with gr.Row(variant="default"):
192
+ running_in="for spaces" if is_running_in_huggingface_spaces() else "portable"
193
+ gr.HTML(f'<h1>Flux Prompt Enhance {running_in} by <a href="https://boosty.to/aicave/donate" style="color: #4AA0E2;">CaveMan</a></h1>')
 
194
  with gr.Row(variant="default"):
195
  # выбор языка UI
196
  radio_lang = gr.Radio(choices = ["RU", "EN"], show_label = False, container = False, type = "value",