diff --git a/frontend/pages/2_Translate.py b/frontend/pages/2_Translate.py index c128646..bd77e18 100644 --- a/frontend/pages/2_Translate.py +++ b/frontend/pages/2_Translate.py @@ -1,3 +1,5 @@ +import json + import streamlit as st import requests import logging @@ -16,7 +18,8 @@ def translate(text: str, language: str): response = requests.post(url, timeout=5) if response.status_code == 200: - return response.text + xlate = json.loads(response.text) + return xlate.strip('"') else: st.error("Failed to translate the text.") return "" diff --git a/frontend/requirements_frontend.txt b/frontend/requirements_frontend.txt index 02118e2..6689031 100644 --- a/frontend/requirements_frontend.txt +++ b/frontend/requirements_frontend.txt @@ -26,6 +26,8 @@ contourpy==1.1.0 # via matplotlib cycler==0.11.0 # via matplotlib +entrypoints==0.4 + # via streamlit-extras faker==19.3.0 # via streamlit-faker favicon==0.7.0 @@ -36,7 +38,7 @@ gitdb==4.0.10 # via gitpython gitpython==3.1.32 # via streamlit -htbuilder==0.6.1 +htbuilder==0.6.2 # via # markdownlit # st-annotated-text @@ -97,6 +99,8 @@ pillow==9.5.0 # via # matplotlib # streamlit +pipdeptree==2.13.1 + # via -r requirements-frontend.in protobuf==4.24.0 # via # streamlit @@ -109,8 +113,6 @@ pygments==2.16.1 # via rich pymdown-extensions==10.1 # via markdownlit -pympler==1.0.1 - # via streamlit pyparsing==3.0.9 # via matplotlib python-dateutil==2.8.2 @@ -150,7 +152,7 @@ soupsieve==2.4.1 # via beautifulsoup4 st-annotated-text==4.0.0 # via streamlit-extras -streamlit==1.25.0 +streamlit==1.28.2 # via # -r requirements-frontend.in # markdownlit @@ -169,7 +171,7 @@ streamlit-card==0.0.61 # via streamlit-extras streamlit-embedcode==0.1.2 # via streamlit-extras -streamlit-extras==0.3.0 +streamlit-extras==0.3.5 # via # -r requirements-frontend.in # markdownlit diff --git a/requirements-frontend.in b/requirements-frontend.in index 97aa35a..2aa489a 100644 --- a/requirements-frontend.in +++ b/requirements-frontend.in @@ -1,6 +1,7 @@ # fe-requirements.in python-dotenv -streamlit -streamlit_extras +streamlit>=1.28.2 +streamlit_extras>=0.3.5 watchdog requests +pipdeptree