clr commited on
Commit
68bf109
·
verified ·
1 Parent(s): cead3b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -69,7 +69,13 @@ def refresh_prompt_fn():
69
  task_id, sentence, normed_text = random.choice(prompts)
70
  tips = _user_instructions(sentence)
71
  #return tuple([task_id, normed_text]), sentence, None, _disp_scorertype('...'), None, None
72
- return tuple([task_id, normed_text]), gr.update(label=tips,value=sentence), None, _disp_scorertype('...'), None, None
 
 
 
 
 
 
73
 
74
 
75
  # heuristic for different instructions
@@ -220,8 +226,10 @@ with bl:
220
  current_prompt = gr.State((None,None))
221
  with gr.Row(equal_height=True):
222
  new_prompt_button = gr.Button("🔃 Endurnýja texta ⮕",scale=0)
223
- prompt_text = gr.Textbox(label="Lestu eftirfarandi texta:", value="[--- dæmi ---]", interactive=False)
 
224
 
 
225
  #with gr.Row(equal_height=True):
226
  #with gr.Column():
227
  user_speech = gr.Audio(sources=["microphone"],type="filepath",
 
69
  task_id, sentence, normed_text = random.choice(prompts)
70
  tips = _user_instructions(sentence)
71
  #return tuple([task_id, normed_text]), sentence, None, _disp_scorertype('...'), None, None
72
+ return [tuple([task_id, normed_text]),
73
+ #gr.update(label=tips,value=sentence),
74
+ gr.update(label=tips, value = [( sentence,1) ] ),
75
+ None,
76
+ _disp_scorertype('...'),
77
+ None,
78
+ None]
79
 
80
 
81
  # heuristic for different instructions
 
226
  current_prompt = gr.State((None,None))
227
  with gr.Row(equal_height=True):
228
  new_prompt_button = gr.Button("🔃 Endurnýja texta ⮕",scale=0)
229
+ #prompt_text = gr.Textbox(label="Lestu eftirfarandi texta:", value="[--- dæmi ---]", interactive=False)
230
+ prompt_text = gr.HighlightedText(label="Lestu eftirfarandi texta:", value=[("[--- dæmi ---]",1)])#, color_map={"hl": "yellow"})
231
 
232
+
233
  #with gr.Row(equal_height=True):
234
  #with gr.Column():
235
  user_speech = gr.Audio(sources=["microphone"],type="filepath",