Jongmo commited on
Commit
6dbe315
1 Parent(s): 791ff6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -49,7 +49,7 @@ def wtr_process(qid):
49
  error_df = pd.DataFrame({'Error': [str(e)]})
50
  return error_df
51
 
52
- import spaces
53
  def prv_process(qid):
54
  target_QID = qid
55
  conn = sqlite3.connect('wikidata_claims_refs_parsed.db')
@@ -59,7 +59,7 @@ def prv_process(qid):
59
  query = f"SELECT * FROM html_text Where entity_id = '{target_QID}'"
60
  reference_text_df = pd.read_sql_query(query, conn)
61
 
62
- verbalised_claims_df_final = spaces.GPU(prv.verbalisation(claim_df))
63
 
64
  progress = gr.Progress(len(verbalised_claims_df_final)) # Create progress bar for Gradio
65
  def update_progress(curr_step, total_steps):
@@ -100,7 +100,7 @@ with gr.Blocks() as demo:
100
  )
101
  out_2 = gr.HTML(label="Results")
102
  run_button_2 = gr.Button("Start processing")
103
- run_button_2.click(fn=prv_process, inp, out_2)
104
 
105
 
106
  if __name__ == "__main__":
 
49
  error_df = pd.DataFrame({'Error': [str(e)]})
50
  return error_df
51
 
52
+
53
  def prv_process(qid):
54
  target_QID = qid
55
  conn = sqlite3.connect('wikidata_claims_refs_parsed.db')
 
59
  query = f"SELECT * FROM html_text Where entity_id = '{target_QID}'"
60
  reference_text_df = pd.read_sql_query(query, conn)
61
 
62
+ verbalised_claims_df_final = prv.verbalisation(claim_df)
63
 
64
  progress = gr.Progress(len(verbalised_claims_df_final)) # Create progress bar for Gradio
65
  def update_progress(curr_step, total_steps):
 
100
  )
101
  out_2 = gr.HTML(label="Results")
102
  run_button_2 = gr.Button("Start processing")
103
+ run_button_2.click(fn=spaces.GPU(prv_process), inp, out_2)
104
 
105
 
106
  if __name__ == "__main__":