davanstrien HF Staff commited on
Commit
b49ef4d
·
1 Parent(s): 79cb63c

move check down

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -170,10 +170,11 @@ with gr.Blocks() as demo:
170
  **Please note** the predictions will take some time since the model needs to be loaded for inference first. If you make a second batch of prediction using the same model the predictions should be quicker."""
171
  )
172
  token = gr.Textbox(label="token", type="password")
173
- if token.value is None:
174
- raise gr.Error("Please enter a valid token")
175
  model_id = gr.Textbox(label="model_id", value="davanstrien/autotrain-wikiart-sample2-42615108993")
176
  button = gr.Button("predict")
 
 
177
  gr.Markdown("## Results")
178
  plot = gr.BarPlot(x="labels", y="freqs", width=600, height=400, vertical=False)
179
  gallery = gr.Gallery()
 
170
  **Please note** the predictions will take some time since the model needs to be loaded for inference first. If you make a second batch of prediction using the same model the predictions should be quicker."""
171
  )
172
  token = gr.Textbox(label="token", type="password")
173
+
 
174
  model_id = gr.Textbox(label="model_id", value="davanstrien/autotrain-wikiart-sample2-42615108993")
175
  button = gr.Button("predict")
176
+ if token.value is None:
177
+ raise gr.Error("Please enter a valid token")
178
  gr.Markdown("## Results")
179
  plot = gr.BarPlot(x="labels", y="freqs", width=600, height=400, vertical=False)
180
  gallery = gr.Gallery()