claree007 commited on
Commit
bce05bf
·
1 Parent(s): d3d9e22
Files changed (1) hide show
  1. app/main.py +5 -2
app/main.py CHANGED
@@ -30,7 +30,9 @@ similarity = Similarity(featurize_fn=lm.featurize)
30
  # response.headers.add("Access-Control-Allow-Origin", "*")
31
  # return response
32
 
33
- def process(text1, text2):
 
 
34
  score = similarity.get_score(text1, text2)
35
  response = {'similarity score': score}
36
  return response
@@ -42,8 +44,9 @@ demo = gr.Interface(
42
  gr.Textbox(lines=2),
43
  ],
44
  outputs=gr.JSON(),
 
45
  )
46
 
47
  if __name__ == "__main__":
48
  # app.run(host="0.0.0.0", port=7860)
49
- demo.launch(share=False, server_name="0.0.0.0", server_port=7860)
 
30
  # response.headers.add("Access-Control-Allow-Origin", "*")
31
  # return response
32
 
33
+ def process(text1, text2): #request: gr.Request
34
+ # text1 = request.query_params.get("text1")
35
+ # text2 = request.query_params.get("text2")
36
  score = similarity.get_score(text1, text2)
37
  response = {'similarity score': score}
38
  return response
 
44
  gr.Textbox(lines=2),
45
  ],
46
  outputs=gr.JSON(),
47
+ allow_flagging="never"
48
  )
49
 
50
  if __name__ == "__main__":
51
  # app.run(host="0.0.0.0", port=7860)
52
+ demo.launch(server_name="0.0.0.0", server_port=7860,)