yoon-gu commited on
Commit
08450ff
β€’
1 Parent(s): f727e2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -82,14 +82,14 @@ MD = """# 포켓λͺ¬ ν€΄μ¦ˆ πŸ¦‘
82
  """
83
 
84
  with gr.Blocks() as demo:
85
- with gr.Row():
86
- gr.LoginButton()
87
- gr.LogoutButton()
88
  with gr.Row():
89
  with gr.Column():
90
  markdown = gr.Markdown(MD.format(content=''))
91
  leader_board = gr.DataFrame(wrap=True, row_count=10)
92
- user = gr.Dropdown(USERS, value="Anonymous", label="μ‚¬μš©μž", info="당신은 λˆ„κ΅¬μ‹ κ°€μš”?", allow_custom_value=True)
 
 
 
93
  quiz_count = gr.Radio([10, 20, 30, 40, 50], value=10, label="총 ν€΄μ¦ˆ 개수", info="ν€΄μ¦ˆλ₯Ό λͺ‡ 개 ν’€ μ˜ˆμ •μΈκ°€μš”?")
94
  with gr.Column():
95
  with gr.Row():
@@ -119,9 +119,10 @@ with gr.Blocks() as demo:
119
  button3 = gr.Button(value="3번")
120
  button4 = gr.Button(value="4번")
121
 
122
- def respond(message, chat_history, user, quiz_count, gen, types, profile: Optional[gr.OAuthProfile]):
123
- print(profile)
124
- if user.strip() == "":
 
125
  raise gr.Error("μ‚¬μš©μž 이름을 μž…λ ₯ν•˜μ„Έμš”.")
126
  message = message.strip()
127
  done = infos[user].done
 
82
  """
83
 
84
  with gr.Blocks() as demo:
 
 
 
85
  with gr.Row():
86
  with gr.Column():
87
  markdown = gr.Markdown(MD.format(content=''))
88
  leader_board = gr.DataFrame(wrap=True, row_count=10)
89
+ with gr.Row():
90
+ gr.LoginButton()
91
+ gr.LogoutButton()
92
+ # user = gr.Dropdown(USERS, value="Anonymous", label="μ‚¬μš©μž", info="당신은 λˆ„κ΅¬μ‹ κ°€μš”?", allow_custom_value=True)
93
  quiz_count = gr.Radio([10, 20, 30, 40, 50], value=10, label="총 ν€΄μ¦ˆ 개수", info="ν€΄μ¦ˆλ₯Ό λͺ‡ 개 ν’€ μ˜ˆμ •μΈκ°€μš”?")
94
  with gr.Column():
95
  with gr.Row():
 
119
  button3 = gr.Button(value="3번")
120
  button4 = gr.Button(value="4번")
121
 
122
+ def respond(message, chat_history, quiz_count, gen, types, profile: Optional[gr.OAuthProfile]):
123
+ if profile:
124
+ user = profile.name
125
+ else:
126
  raise gr.Error("μ‚¬μš©μž 이름을 μž…λ ₯ν•˜μ„Έμš”.")
127
  message = message.strip()
128
  done = infos[user].done