JRQi commited on
Commit
cf06e4b
β€’
1 Parent(s): 952bac4

Update game1.py

Browse files
Files changed (1) hide show
  1. game1.py +20 -20
game1.py CHANGED
@@ -219,12 +219,12 @@ def func1(lang_selected, num_selected, human_predict, num1, num2, user_important
219
  else:
220
  chatbot.append(("The correct answer is " + str(golden_label) + ". Sorry... No one gets the correct answer. But nice try! πŸ˜‰", user_select))
221
 
222
- data = pd.DataFrame(
223
- {
224
- "Role": ["AI πŸ€–", "HUMAN πŸ‘¨πŸ‘©"],
225
- "Scores": [num2, num1],
226
- }
227
- )
228
  # scroe_human = ''' # Human: ''' + str(int(num1))
229
  # scroe_robot = ''' # Robot: ''' + str(int(num2))
230
  tot_scores = ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(num2)) + ''' &ensp; VS &ensp; ''' + str(int(num1)) + ''' &ensp; Human </p>'''
@@ -232,21 +232,21 @@ def func1(lang_selected, num_selected, human_predict, num1, num2, user_important
232
 
233
  num_tmp = max(num1, num2)
234
  y_lim_upper = (int((num_tmp + 3)/10)+1) * 10
235
- figure = gr.BarPlot.update(
236
- data,
237
- x="Role",
238
- y="Scores",
239
- color="Role",
240
- vertical=False,
241
- y_lim=[0,y_lim_upper],
242
- color_legend_position='none',
243
- height=250,
244
- width=500,
245
- show_label=False,
246
- container=False,
247
- )
248
  # tooltip=["Role", "Scores"],
249
- return ai_predict, chatbot, num1, num2, tot_scores, figure
250
 
251
  def interpre1(lang_selected, num_selected):
252
  if lang_selected in ['en']:
 
219
  else:
220
  chatbot.append(("The correct answer is " + str(golden_label) + ". Sorry... No one gets the correct answer. But nice try! πŸ˜‰", user_select))
221
 
222
+ # data = pd.DataFrame(
223
+ # {
224
+ # "Role": ["AI πŸ€–", "HUMAN πŸ‘¨πŸ‘©"],
225
+ # "Scores": [num2, num1],
226
+ # }
227
+ # )
228
  # scroe_human = ''' # Human: ''' + str(int(num1))
229
  # scroe_robot = ''' # Robot: ''' + str(int(num2))
230
  tot_scores = ''' ### <p style="text-align: center;"> Machine &ensp; ''' + str(int(num2)) + ''' &ensp; VS &ensp; ''' + str(int(num1)) + ''' &ensp; Human </p>'''
 
232
 
233
  num_tmp = max(num1, num2)
234
  y_lim_upper = (int((num_tmp + 3)/10)+1) * 10
235
+ # figure = gr.BarPlot.update(
236
+ # data,
237
+ # x="Role",
238
+ # y="Scores",
239
+ # color="Role",
240
+ # vertical=False,
241
+ # y_lim=[0,y_lim_upper],
242
+ # color_legend_position='none',
243
+ # height=250,
244
+ # width=500,
245
+ # show_label=False,
246
+ # container=False,
247
+ # )
248
  # tooltip=["Role", "Scores"],
249
+ return ai_predict, chatbot, num1, num2, tot_scores
250
 
251
  def interpre1(lang_selected, num_selected):
252
  if lang_selected in ['en']: