LeoGitGuy commited on
Commit
3de0849
1 Parent(s): cd0d721
Files changed (2) hide show
  1. main.py +2 -2
  2. static/script.js +1 -1
main.py CHANGED
@@ -18,10 +18,10 @@ pipeline = create_readers_and_pipeline(retriever, text_reader_type, table_reader
18
  @app.get("/answer")
19
  def t5(input):
20
  prediction = pipeline.run(
21
- query=input, params={"top_k": 10}
22
  )
23
  answer_list = [a.answer for a in prediction["answers"]]
24
-
25
  return {"output": ("\n").join(answer_list)}
26
 
27
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
 
18
  @app.get("/answer")
19
  def t5(input):
20
  prediction = pipeline.run(
21
+ query=input, params={"top_k": 3}
22
  )
23
  answer_list = [a.answer for a in prediction["answers"]]
24
+ print(f"Answer List: {answer_list}")
25
  return {"output": ("\n").join(answer_list)}
26
 
27
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
static/script.js CHANGED
@@ -3,7 +3,7 @@ const textGenForm = document.querySelector('.text-gen-form');
3
  const translateText = async (text) => {
4
  const inferResponse = await fetch(`answer?input=${text}`);
5
  const inferJson = await inferResponse.json();
6
-
7
  return inferJson.output;
8
  };
9
 
 
3
  const translateText = async (text) => {
4
  const inferResponse = await fetch(`answer?input=${text}`);
5
  const inferJson = await inferResponse.json();
6
+ console.log(inferJson.output)
7
  return inferJson.output;
8
  };
9