Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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%;
|