elibrowne commited on
Commit
d079c5e
·
1 Parent(s): bd9cdf6

Attempting markdown extension

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -6,6 +6,7 @@ import os
6
  import json
7
  from huggingface_hub import hf_hub_download, file_exists, HfApi
8
  from random import shuffle
 
9
 
10
  # Global variables which interact with loading and unloading
11
  user_data = {}
@@ -212,9 +213,9 @@ with gr.Blocks(theme = theme) as user_eval:
212
  # Add user data to the current response as SET evaluation, which comes before the generation
213
  current_response[user_data["modes"][user_data["current"]][mode] + "_set"] = [e_h, e_s]
214
  return {
215
- selection: gr.Markdown("""
216
- ## Autogenerated Response\n
217
- """ + current_question["generation_" + user_data["modes"][user_data["current"]][mode]]),
218
  eval_helps: gr.Slider(value = 0),
219
  eval_satisfied: gr.Slider(value = 3)
220
  }
@@ -248,9 +249,9 @@ with gr.Blocks(theme = theme) as user_eval:
248
  # The user just evaluated the gold passage
249
  current_response["gold_set"] = [e_h, e_s]
250
  return {
251
- selection: gr.Markdown("""
252
- ## Autogenerated Response\n
253
- """ + current_question["gold_passage_generation"]),
254
  forward_btn: gr.Textbox(),
255
  eval_helps: gr.Slider(value = 0),
256
  eval_satisfied: gr.Slider(value = 3)
 
6
  import json
7
  from huggingface_hub import hf_hub_download, file_exists, HfApi
8
  from random import shuffle
9
+ from markdown import markdown
10
 
11
  # Global variables which interact with loading and unloading
12
  user_data = {}
 
213
  # Add user data to the current response as SET evaluation, which comes before the generation
214
  current_response[user_data["modes"][user_data["current"]][mode] + "_set"] = [e_h, e_s]
215
  return {
216
+ selection: gr.HTML("""
217
+ <h2> Autogenerated Response </h2>
218
+ <p>""" + markdown(current_question["generation_" + user_data["modes"][user_data["current"]][mode]]) + "</p>"),
219
  eval_helps: gr.Slider(value = 0),
220
  eval_satisfied: gr.Slider(value = 3)
221
  }
 
249
  # The user just evaluated the gold passage
250
  current_response["gold_set"] = [e_h, e_s]
251
  return {
252
+ selection: gr.HTML("""
253
+ <h2> Autogenerated Response </h2>
254
+ <p> """ + markdown(current_question["gold_passage_generation"]) + "</p>"),
255
  forward_btn: gr.Textbox(),
256
  eval_helps: gr.Slider(value = 0),
257
  eval_satisfied: gr.Slider(value = 3)