EveSa commited on
Commit
9cd8995
1 Parent(s): 1f86975

fix(function): fix name function and their calls

Browse files
Files changed (3) hide show
  1. src/api.py +4 -4
  2. src/inference_lstm.py +1 -1
  3. src/inference_t5.py +1 -1
src/api.py CHANGED
@@ -2,17 +2,17 @@ from fastapi import FastAPI, Form, Request
2
  from fastapi.staticfiles import StaticFiles
3
  from fastapi.templating import Jinja2Templates
4
 
5
- from src.inference_lstm import inferenceAPI
6
- from src.inference_t5 import inferenceAPI
7
 
8
 
9
  # ------ INFERENCE MODEL --------------------------------------------------------------
10
  # appel de la fonction inference, adaptee pour une entree txt
11
  def summarize(text: str):
12
  if choisir_modele.var == "lstm":
13
- return " ".join(inferenceAPI(text))
14
  elif choisir_modele.var == "fineTunedT5":
15
- text = inferenceAPI_t5(text)
16
 
17
 
18
  # ----------------------------------------------------------------------------------
 
2
  from fastapi.staticfiles import StaticFiles
3
  from fastapi.templating import Jinja2Templates
4
 
5
+ from src.inference_lstm import inference_lstm
6
+ from src.inference_t5 import inference_t5
7
 
8
 
9
  # ------ INFERENCE MODEL --------------------------------------------------------------
10
  # appel de la fonction inference, adaptee pour une entree txt
11
  def summarize(text: str):
12
  if choisir_modele.var == "lstm":
13
+ return " ".join(inference_lstm(text))
14
  elif choisir_modele.var == "fineTunedT5":
15
+ text = inference_t5(text)
16
 
17
 
18
  # ----------------------------------------------------------------------------------
src/inference_lstm.py CHANGED
@@ -15,7 +15,7 @@ with open("model/vocab.pkl", "rb") as vocab:
15
  vectoriser = dataloader.Vectoriser(words)
16
 
17
 
18
- def inferenceAPI(text: str) -> str:
19
  """
20
  Predict the summary for an input text
21
  --------
 
15
  vectoriser = dataloader.Vectoriser(words)
16
 
17
 
18
+ def inference_lstm(text: str) -> str:
19
  """
20
  Predict the summary for an input text
21
  --------
src/inference_t5.py CHANGED
@@ -17,7 +17,7 @@ def clean_text(texts: str) -> str:
17
  return texts
18
 
19
 
20
- def inferenceAPI(text: str) -> str:
21
  """
22
  Predict the summary for an input text
23
  --------
 
17
  return texts
18
 
19
 
20
+ def inference_t5(text: str) -> str:
21
  """
22
  Predict the summary for an input text
23
  --------