Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,23 +14,23 @@ from io import BytesIO
|
|
14 |
hf_token = os.getenv("MisterAI_bigscience_bloom_560m")
|
15 |
|
16 |
# Fenêtre d'authentification
|
17 |
-
with gr.Blocks() as auth_demo:
|
18 |
-
hf_token_input = gr.Textbox(label="Hugging Face Token")
|
19 |
-
auth_button = gr.Button("Authentifier")
|
20 |
-
|
21 |
-
def authenticate(hf_token):
|
22 |
-
# Configurer le token pour l'utilisation avec Hugging Face
|
23 |
-
if hf_token:
|
24 |
-
HfFolder.save_token(hf_token)
|
25 |
-
else:
|
26 |
-
raise ValueError("Le token Hugging Face n'est pas configuré. Assurez-vous qu'il est défini dans les variables d'environnement.")
|
27 |
-
|
28 |
-
auth_button.click(
|
29 |
-
authenticate,
|
30 |
-
inputs=hf_token_input,
|
31 |
-
outputs=gr.Textbox(value="Authentification réussie", visible=False)
|
32 |
-
)
|
33 |
-
|
34 |
# Créer une instance de HfFileSystem
|
35 |
fs = HfFileSystem()
|
36 |
|
|
|
14 |
hf_token = os.getenv("MisterAI_bigscience_bloom_560m")
|
15 |
|
16 |
# Fenêtre d'authentification
|
17 |
+
#with gr.Blocks() as auth_demo:
|
18 |
+
# hf_token_input = gr.Textbox(label="Hugging Face Token")
|
19 |
+
# auth_button = gr.Button("Authentifier")
|
20 |
+
#
|
21 |
+
# def authenticate(hf_token):
|
22 |
+
# # Configurer le token pour l'utilisation avec Hugging Face
|
23 |
+
# if hf_token:
|
24 |
+
# HfFolder.save_token(hf_token)
|
25 |
+
# else:
|
26 |
+
# raise ValueError("Le token Hugging Face n'est pas configuré. Assurez-vous qu'il est défini dans les variables d'environnement.")
|
27 |
+
#
|
28 |
+
# auth_button.click(
|
29 |
+
# authenticate,
|
30 |
+
# inputs=hf_token_input,
|
31 |
+
# outputs=gr.Textbox(value="Authentification réussie", visible=False)
|
32 |
+
# )
|
33 |
+
#
|
34 |
# Créer une instance de HfFileSystem
|
35 |
fs = HfFileSystem()
|
36 |
|