Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,6 @@ from pathlib import Path
|
|
| 5 |
import gradio as gr
|
| 6 |
from huggingface_hub import InferenceClient
|
| 7 |
|
| 8 |
-
def load_registered_teams():
|
| 9 |
-
return {"admin": "Admin", "team1": "Team1"}
|
| 10 |
|
| 11 |
import os
|
| 12 |
from supabase import create_client, Client
|
|
@@ -16,6 +14,10 @@ key: str = os.environ.get("SUPABASE_KEY")
|
|
| 16 |
supabase: Client = create_client(url, key)
|
| 17 |
print(supabase)
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
REGISTERED_TEAMS = load_registered_teams()
|
| 21 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
from huggingface_hub import InferenceClient
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
| 9 |
import os
|
| 10 |
from supabase import create_client, Client
|
|
|
|
| 14 |
supabase: Client = create_client(url, key)
|
| 15 |
print(supabase)
|
| 16 |
|
| 17 |
+
def load_registered_teams():
|
| 18 |
+
result = supabase.table("teams").select("*").execute()
|
| 19 |
+
print(result["data"])
|
| 20 |
+
return {team["name"].casefold(): team["name"] for team in result["data"]}
|
| 21 |
|
| 22 |
REGISTERED_TEAMS = load_registered_teams()
|
| 23 |
|