king007 commited on
Commit
3cc8925
·
1 Parent(s): 284fdbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -38,11 +38,13 @@ def getQuestionAndPrompt():
38
  return choice1,choice2
39
 
40
  def test():
41
- table = pd.read_csv("prompts.csv", header=0).astype(str)
42
- return "",table
 
43
 
44
  question_textbox = gr.Textbox(label="", lines=10)
45
  prompt_textbox = gr.Textbox(label="", lines=10)
 
46
  gr.Interface(fn=test,
47
  inputs=[],
48
- outputs=[question_textbox, prompt_textbox]).launch()
 
38
  return choice1,choice2
39
 
40
  def test():
41
+ table_df = pd.read_csv("prompts.csv", header=0)
42
+ table_json=table_df.to_json(orient="records")
43
+ return "",table_json
44
 
45
  question_textbox = gr.Textbox(label="", lines=10)
46
  prompt_textbox = gr.Textbox(label="", lines=10)
47
+ json_output=gr.JSON(label="Output", visible=True)
48
  gr.Interface(fn=test,
49
  inputs=[],
50
+ outputs=[question_textbox, json_output]).launch()