Skip to content

Commit

Permalink
add doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorenkovaURFU committed Mar 13, 2024
1 parent 7b19d0f commit 08a6df6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,30 @@


@app.get("/")
def root():
def root() -> dict:
"""
This function works from root
and demonstrates welcome message.
Returns:
dict: Welcome message
"""
return {"message": "Hello World"}


@app.post("/predict/")
# функция для расчета модели,
# в "input" передаются текст
def predict(input: dict):
def predict(input: dict) -> dict:
"""
This function predicts
Args:
input (dict): dict with text for prediction
Returns:
dict: dict with the prediction of text sentiment
"""
inputs = tokenizer(
input["text"],
max_length=512,
Expand Down

0 comments on commit 08a6df6

Please sign in to comment.