mturan commited on
Commit
1f1cc5b
1 Parent(s): 1be4ff0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -9,15 +9,15 @@ from langdetect import detect, DetectorFactory
9
  DetectorFactory.seed = 42
10
 
11
  app = FastAPI()
12
- nemo_model = Urdu()
13
- multi_model = MultiLingual()
14
 
15
 
16
  def punctuate(text: str) -> str:
17
  if detect(text) == "ur":
18
- return nemo_model.punctuate(text)
19
  else:
20
- return multi_model.punctuate(text)
21
 
22
 
23
  title = "SELMA H2020 — Multilingual Punctuation & Casing Prediction"
 
9
  DetectorFactory.seed = 42
10
 
11
  app = FastAPI()
12
+ hf_model = Urdu()
13
+ nemo_model = MultiLingual()
14
 
15
 
16
  def punctuate(text: str) -> str:
17
  if detect(text) == "ur":
18
+ return hf_model.punctuate(text)
19
  else:
20
+ return nemo_model.punctuate(text)
21
 
22
 
23
  title = "SELMA H2020 — Multilingual Punctuation & Casing Prediction"