ovieyra21 commited on
Commit
a9a94f3
·
verified ·
1 Parent(s): f745826

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -11,7 +11,17 @@ from transformers.pipelines.audio_utils import ffmpeg_read
11
  import tempfile
12
  import time
13
  import gradio as gr
14
- OAUTH_CLIENT_ID = os.getenv("hf_oauth")
 
 
 
 
 
 
 
 
 
 
15
  css = """
16
  #intro{
17
  max-width: 100%;
 
11
  import tempfile
12
  import time
13
  import gradio as gr
14
+ import { oauthLoginUrl, oauthHandleRedirectIfPresent } from "@huggingface/hub";
15
+
16
+ const oauthResult = await oauthHandleRedirectIfPresent();
17
+
18
+ if (!oauthResult) {
19
+ // If the user is not logged in, redirect to the login page
20
+ window.location.href = await oauthLoginUrl();
21
+ }
22
+
23
+ // You can use oauthResult.accessToken, oauthResult.userInfo among other things
24
+ console.log(oauthResult);
25
  css = """
26
  #intro{
27
  max-width: 100%;