Zaid commited on
Commit
a636dc2
·
verified ·
1 Parent(s): ad4597f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -114,6 +114,7 @@ with gr.Blocks(css_paths="style.css", fill_height=True) as demo:
114
  # Validate token using Hugging Face Hub API
115
  login(token = hf_token)
116
  load_model()
 
117
  return f"Authenticated successfully"
118
  except HfHubHTTPError:
119
  return "Invalid token. Please try again."
@@ -122,7 +123,10 @@ with gr.Blocks(css_paths="style.css", fill_height=True) as demo:
122
  token_input = gr.Textbox(label="Hugging Face Access Token", type="password", placeholder="Enter your token here...")
123
  auth_button = gr.Button("Authenticate")
124
  output = gr.Textbox(label="Output")
125
- chat_interface.render()
 
 
 
126
 
127
  if __name__ == "__main__":
128
  demo.queue(max_size=20).launch()
 
114
  # Validate token using Hugging Face Hub API
115
  login(token = hf_token)
116
  load_model()
117
+ chat_interface.render()
118
  return f"Authenticated successfully"
119
  except HfHubHTTPError:
120
  return "Invalid token. Please try again."
 
123
  token_input = gr.Textbox(label="Hugging Face Access Token", type="password", placeholder="Enter your token here...")
124
  auth_button = gr.Button("Authenticate")
125
  output = gr.Textbox(label="Output")
126
+
127
+ auth_button.click(fn=authenticate_token, inputs=token_input, outputs=output)
128
+
129
+
130
 
131
  if __name__ == "__main__":
132
  demo.queue(max_size=20).launch()