mkshing commited on
Commit
23ef29e
1 Parent(s): 4e2136a
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -85,10 +85,20 @@ You can assign a GPU in the {SETTINGS} tab if you are running this on HF Spaces.
85
  """
86
 
87
 
 
 
 
 
 
 
88
  with gr.Blocks() as demo:
 
 
 
 
89
  gr.Markdown("""# Chat with `rinna/japanese-gpt-neox-3.6b-instruction-sft`
90
  <a href=\"https://colab.research.google.com/github/mkshing/notebooks/blob/main/rinna_japanese_gpt_neox_3_6b_instruction_sft.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>
91
-
92
  This demo is a chat UI for [rinna/japanese-gpt-neox-3.6b-instruction-sft](https://huggingface.co/rinna/japanese-gpt-neox-3.6b-instruction-sft).
93
  """)
94
  with gr.Accordion("Configs", open=False):
 
85
  """
86
 
87
 
88
+ def show_warning(warning_text: str) -> gr.Blocks:
89
+ with gr.Blocks() as demo:
90
+ with gr.Box():
91
+ gr.Markdown(warning_text)
92
+ return demo
93
+
94
  with gr.Blocks() as demo:
95
+ if os.getenv('IS_SHARED_UI'):
96
+ show_warning(SHARED_UI_WARNING)
97
+ if not torch.cuda.is_available():
98
+ show_warning(CUDA_NOT_AVAILABLE_WARNING)
99
  gr.Markdown("""# Chat with `rinna/japanese-gpt-neox-3.6b-instruction-sft`
100
  <a href=\"https://colab.research.google.com/github/mkshing/notebooks/blob/main/rinna_japanese_gpt_neox_3_6b_instruction_sft.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>
101
+
102
  This demo is a chat UI for [rinna/japanese-gpt-neox-3.6b-instruction-sft](https://huggingface.co/rinna/japanese-gpt-neox-3.6b-instruction-sft).
103
  """)
104
  with gr.Accordion("Configs", open=False):