Spaces:
Build error
Build error
null and void
commited on
Update app.py
Browse filesremoved oAuth login
app.py
CHANGED
|
@@ -3,20 +3,6 @@ import torch
|
|
| 3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 4 |
import time
|
| 5 |
import os
|
| 6 |
-
from huggingface_hub import whoami
|
| 7 |
-
|
| 8 |
-
# Hugging Face login
|
| 9 |
-
def hello(profile: gr.OAuthProfile | None) -> str:
|
| 10 |
-
if profile is None:
|
| 11 |
-
return "I don't know you."
|
| 12 |
-
return f"Hello {profile.name}"
|
| 13 |
-
|
| 14 |
-
def list_organizations(oauth_token: gr.OAuthToken | None) -> str:
|
| 15 |
-
if oauth_token is None:
|
| 16 |
-
return "Please log in to list organizations."
|
| 17 |
-
org_names = [org["name"] for org in whoami(oauth_token.token)["orgs"]]
|
| 18 |
-
return f"You belong to {', '.join(org_names)}."
|
| 19 |
-
|
| 20 |
|
| 21 |
class ConversationManager:
|
| 22 |
def __init__(self):
|
|
@@ -213,11 +199,6 @@ open_source_models = [
|
|
| 213 |
]
|
| 214 |
|
| 215 |
with gr.Blocks() as demo:
|
| 216 |
-
gr.LoginButton()
|
| 217 |
-
m1 = gr.Markdown()
|
| 218 |
-
m2 = gr.Markdown()
|
| 219 |
-
demo.load(hello, inputs=None, outputs=m1)
|
| 220 |
-
demo.load(list_organizations, inputs=None, outputs=m2)
|
| 221 |
gr.Markdown("# ConversAI Playground")
|
| 222 |
|
| 223 |
with gr.Row():
|
|
|
|
| 3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 4 |
import time
|
| 5 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
class ConversationManager:
|
| 8 |
def __init__(self):
|
|
|
|
| 199 |
]
|
| 200 |
|
| 201 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
gr.Markdown("# ConversAI Playground")
|
| 203 |
|
| 204 |
with gr.Row():
|