ziem-io commited on
Commit
88b3da2
·
1 Parent(s): 4c56373

Update: Adjust form

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -173,19 +173,17 @@ def replace_text():
173
 
174
  def get_device_info():
175
  if torch.cuda.is_available():
176
- txt = f"Runs on GPU: {torch.cuda.get_device_name(0)}"
177
  else:
178
- txt = "Runs on CPU"
179
-
180
- return f"<span style='color: rgb(113, 113, 122);'>{txt}</span>"
181
 
182
  ### Create Form interface with Gradio Framework ##################################
183
  with gr.Blocks() as demo:
184
- gr.Markdown("## Submit Whisky Review for Classification")
185
 
186
  with gr.Row(): # alles nebeneinander
187
  with gr.Column(scale=1): # linke Seite: Input
188
- device_label = gr.Markdown(get_device_info())
189
  review_box = gr.Textbox(
190
  label="Whisky Review",
191
  lines=8,
 
173
 
174
  def get_device_info():
175
  if torch.cuda.is_available():
176
+ return f"Runs on GPU: {torch.cuda.get_device_name(0)}"
177
  else:
178
+ return "Runs on CPU (May be slower)"
 
 
179
 
180
  ### Create Form interface with Gradio Framework ##################################
181
  with gr.Blocks() as demo:
182
+ gr.HTML("<h2>Submit Whisky Review for Classification</h2>")
183
 
184
  with gr.Row(): # alles nebeneinander
185
  with gr.Column(scale=1): # linke Seite: Input
186
+ device_label = gr.HTML(f"<span style='color: var(--block-title-text-color)'>{get_device_info()}</span>")
187
  review_box = gr.Textbox(
188
  label="Whisky Review",
189
  lines=8,