Jackss
commited on
Commit
·
f2e9e61
1
Parent(s):
ccadd77
Stuff
Browse files- main.py +1 -1
- static/index.html +5 -5
main.py
CHANGED
@@ -23,7 +23,7 @@ app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
|
23 |
def index() -> FileResponse:
|
24 |
return FileResponse(path="/app/static/index.html", media_type="text/html")
|
25 |
|
26 |
-
@app.
|
27 |
def similarity(input):
|
28 |
papers = input['papers']
|
29 |
title_abs = [d['title'] + tokenizer.sep_token + (d.get('abstract') or '') for d in papers]
|
|
|
23 |
def index() -> FileResponse:
|
24 |
return FileResponse(path="/app/static/index.html", media_type="text/html")
|
25 |
|
26 |
+
@app.get('/similarity')
|
27 |
def similarity(input):
|
28 |
papers = input['papers']
|
29 |
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: '
|
23 |
-
headers: {
|
24 |
-
|
25 |
-
|
26 |
-
},
|
27 |
body: JSON.stringify(papers)
|
28 |
});
|
29 |
|
|
|
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 |
|