Jackss commited on
Commit
3c07819
·
1 Parent(s): b4549f3
Files changed (2) hide show
  1. main.py +1 -1
  2. static/index.html +5 -5
main.py CHANGED
@@ -19,7 +19,7 @@ app = FastAPI()
19
 
20
 
21
 
22
- @app.get('/similarity')
23
  def similarity(input):
24
  papers = input['papers']
25
  title_abs = [d['title'] + tokenizer.sep_token + (d.get('abstract') or '') for d in papers]
 
19
 
20
 
21
 
22
+ @app.post('/similarity')
23
  def similarity(input):
24
  papers = input['papers']
25
  title_abs = [d['title'] + tokenizer.sep_token + (d.get('abstract') or '') for d in papers]
static/index.html CHANGED
@@ -19,11 +19,11 @@
19
 
20
  async function getSimilarity(papers) {
21
  const response = await fetch('similarity', {
22
- method: 'GET',
23
- // headers: {
24
- // 'Accept': 'application/json',
25
- // 'Content-Type': 'application/json'
26
- // },
27
  body: JSON.stringify(papers)
28
  });
29
 
 
19
 
20
  async function getSimilarity(papers) {
21
  const response = await fetch('similarity', {
22
+ method: 'POST',
23
+ headers: {
24
+ 'Accept': 'application/json',
25
+ 'Content-Type': 'application/json'
26
+ },
27
  body: JSON.stringify(papers)
28
  });
29