andreska commited on
Commit
48fc6d8
·
verified ·
1 Parent(s): 5344fa0

Changed question to input and output to output. Changed javascript to only alert

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -20,15 +20,15 @@ def process_message(message):
20
  # JavaScript for message handling
21
  js = """
22
  function on_message(event) {
23
- if (event.data && event.data.projectData) {
24
  // Access the gradio elements through window.gradio
25
- const projectData = event.data.projectData;
26
- const question = event.data.question;
27
  alert('test');
28
  // Update the textboxes
29
- document.querySelector('#project_data textarea').value = projectData;
30
- document.querySelector('#output textarea').value = question;
31
- }
32
  }
33
  window.addEventListener('message', on_message);
34
  """
@@ -56,7 +56,7 @@ with gr.Blocks(js=js) as demo:
56
  update_btn = gr.Button("Update Values")
57
  update_btn.click(
58
  fn=update_values,
59
- inputs=[project_data, output],
60
  outputs=output
61
  )
62
 
 
20
  # JavaScript for message handling
21
  js = """
22
  function on_message(event) {
23
+ //if (event.data && event.data.projectData) {
24
  // Access the gradio elements through window.gradio
25
+ // const projectData = event.data.projectData;
26
+ // const question = event.data.question;
27
  alert('test');
28
  // Update the textboxes
29
+ // document.querySelector('#project_data textarea').value = projectData;
30
+ // document.querySelector('#output textarea').value = question;
31
+ //}
32
  }
33
  window.addEventListener('message', on_message);
34
  """
 
56
  update_btn = gr.Button("Update Values")
57
  update_btn.click(
58
  fn=update_values,
59
+ inputs=[project_data, question],
60
  outputs=output
61
  )
62