Spaces:
Runtime error
Runtime error
Download InferenceServer.py from wldmr/rpunct-sl-app: direct link, hf CLI and curl.
- Browser
- Download file 412 Bytes
-
https://huggingface.co/spaces/wldmr/rpunct-sl-app/resolve/main/InferenceServer.py
- Command line
-
hf download hf://spaces/wldmr/rpunct-sl-app/InferenceServer.py
-
curl -L -o InferenceServer.py https://huggingface.co/spaces/wldmr/rpunct-sl-app/resolve/main/InferenceServer.py
412 Bytes
| from rpunct import RestorePuncts | |
| print("Loading Model...") | |
| rpunct = RestorePuncts() | |
| from fastapi import FastAPI | |
| app = FastAPI() | |
| print("Models loaded !") | |
| def read_root(): | |
| return {"Homepage!"} | |
| def get_correction(input_sentence): | |
| '''Returns sentence with correct punctuations and case''' | |
| return {"corrected_sentence": rpunct.punctuate(input_sentence, lang="en")} |