Darshan commited on
Commit
31984b2
1 Parent(s): 0bb4b6a

change api method

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. app.py +1 -1
Dockerfile CHANGED
@@ -19,7 +19,7 @@ WORKDIR $HOME/app
19
  COPY --chown=user . $HOME/app
20
 
21
  # Install requirements.txt
22
- RUN pip install --no-cache-dir --upgrade -r /requirements.txt
23
 
24
  # Start the FastAPI app on port 7860, the default port expected by Spaces
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
19
  COPY --chown=user . $HOME/app
20
 
21
  # Install requirements.txt
22
+ RUN pip install --upgrade -r /requirements.txt
23
 
24
  # Start the FastAPI app on port 7860, the default port expected by Spaces
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -71,7 +71,7 @@ class TranslateRequest(BaseModel):
71
  target_lang: str
72
 
73
 
74
- @app.get("/translate/")
75
  def translate(request: TranslateRequest):
76
  try:
77
  result = translate_text(request.sentences, request.target_lang)
 
71
  target_lang: str
72
 
73
 
74
+ @app.post("/translate/")
75
  def translate(request: TranslateRequest):
76
  try:
77
  result = translate_text(request.sentences, request.target_lang)