Spaces:
Runtime error
Runtime error
Kyuho Heo commited on
Commit ·
efc63fc
1
Parent(s): c24e2b2
test
Browse files
app.py
CHANGED
|
@@ -63,20 +63,6 @@ except Exception:
|
|
| 63 |
|
| 64 |
tab_keys = ["Category", "Language"]
|
| 65 |
|
| 66 |
-
def handle_auth(
|
| 67 |
-
profile: gr.OAuthProfile,
|
| 68 |
-
token: gr.OAuthToken,
|
| 69 |
-
prev_token: Optional[str]
|
| 70 |
-
) -> Tuple[str, str, Optional[str]]:
|
| 71 |
-
if prev_token is not None and token in None:
|
| 72 |
-
return "", "", None
|
| 73 |
-
|
| 74 |
-
if token is not None and token.token != prev_token:
|
| 75 |
-
username = profile.username
|
| 76 |
-
orgs = get_organizations(token.token)
|
| 77 |
-
return username, orgs, token.token
|
| 78 |
-
|
| 79 |
-
return gr.no_update, gr.no_update, prev_token
|
| 80 |
|
| 81 |
demo = gr.Blocks(css=custom_css)
|
| 82 |
with demo:
|
|
@@ -219,10 +205,8 @@ with demo:
|
|
| 219 |
repetition_penalty_textbox = gr.Textbox(label="Repetition penalty (default: 1.0)", placeholder="1.0")
|
| 220 |
|
| 221 |
login_button = gr.LoginButton()
|
| 222 |
-
state_token = gr.State(None, persistent=True)
|
| 223 |
-
login_button.click(handle_auth, inputs=[login_button, login_button, state_token], outputs=[user_state, organization_state, state_token])
|
| 224 |
-
submit_button = gr.Button("Submit Eval")
|
| 225 |
|
|
|
|
| 226 |
submission_result = gr.Markdown()
|
| 227 |
event = submit_button.click(get_profile_and_organizations, inputs=[], outputs=[user_state, organization_state])
|
| 228 |
event.then(
|
|
|
|
| 63 |
|
| 64 |
tab_keys = ["Category", "Language"]
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
demo = gr.Blocks(css=custom_css)
|
| 68 |
with demo:
|
|
|
|
| 205 |
repetition_penalty_textbox = gr.Textbox(label="Repetition penalty (default: 1.0)", placeholder="1.0")
|
| 206 |
|
| 207 |
login_button = gr.LoginButton()
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
+
submit_button = gr.Button("Submit Eval")
|
| 210 |
submission_result = gr.Markdown()
|
| 211 |
event = submit_button.click(get_profile_and_organizations, inputs=[], outputs=[user_state, organization_state])
|
| 212 |
event.then(
|