Spaces:
Runtime error
Runtime error
Commit
•
83eedef
1
Parent(s):
93f1414
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ is_spaces = True if os.environ.get("SPACE_ID") else False
|
|
6 |
if is_spaces:
|
7 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
8 |
import spaces
|
|
|
9 |
|
10 |
|
11 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
@@ -230,8 +231,9 @@ h3{margin-top: 0}
|
|
230 |
.tabitem{border: 0px}
|
231 |
"""
|
232 |
|
233 |
-
def swap_visibilty(profile: Union[gr.OAuthProfile, None]):
|
234 |
-
|
|
|
235 |
if is_spaces:
|
236 |
if profile is None:
|
237 |
return gr.update(elem_classes=["main_ui_logged_out"])
|
|
|
6 |
if is_spaces:
|
7 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
8 |
import spaces
|
9 |
+
from huggingface_hub import whoami
|
10 |
|
11 |
|
12 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
|
|
231 |
.tabitem{border: 0px}
|
232 |
"""
|
233 |
|
234 |
+
def swap_visibilty(profile: Union[gr.OAuthProfile, None], oauth_token: Union[gr.OAuthToken, None]):
|
235 |
+
user = whoami(oauth_token.token)
|
236 |
+
print(user)
|
237 |
if is_spaces:
|
238 |
if profile is None:
|
239 |
return gr.update(elem_classes=["main_ui_logged_out"])
|