Spaces:
Running on CPU Upgrade

ziem-io commited on
Commit
1529238
·
1 Parent(s): ba84108

Update: Text

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -103,7 +103,7 @@ def predict(review: str):
103
  # Abort if text is not english
104
  if not review_is_eng:
105
  review = _translate_en(review)
106
- html_out += f"""<div style='border-radius: 2px; padding: 1px 5px; background-color: rgb(255, 237, 213);'>Your text has been automatically translated</div>
107
  <p>{review}</p>
108
  """
109
  is_translated = True
@@ -144,9 +144,9 @@ def random_text():
144
 
145
  def _get_device_info():
146
  if torch.cuda.is_available():
147
- return f"<span style='border-radius: 2px; padding: 1px 5px; background-color: rgb(220, 252, 231);'>Runs on GPU: {torch.cuda.get_device_name(0)}</span>"
148
  else:
149
- return "<span style='border-radius: 2px; padding: 1px 5px; background-color: rgb(255, 237, 213);'>Runs on CPU (May be slower)</span>"
150
 
151
  ### Create Form interface with Gradio Framework ##################################
152
  custom_css = """
 
103
  # Abort if text is not english
104
  if not review_is_eng:
105
  review = _translate_en(review)
106
+ html_out += f"""<strong style='margin-bottom: 0.5em'>Your text has been automatically translated:</strong>
107
  <p>{review}</p>
108
  """
109
  is_translated = True
 
144
 
145
  def _get_device_info():
146
  if torch.cuda.is_available():
147
+ return f" Runs on GPU: {torch.cuda.get_device_name(0)}"
148
  else:
149
+ return " Runs on CPU (May be slower)"
150
 
151
  ### Create Form interface with Gradio Framework ##################################
152
  custom_css = """