Skip to content

Commit

Permalink
Merge branch 'frontend-upgrade' into 'main'
Browse files Browse the repository at this point in the history
frontend upgrade

See merge request johndutchover/insight-ai-api!20
  • Loading branch information
John Dutchover committed Nov 16, 2023
2 parents 6be60b6 + 909f813 commit 85a0301
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion frontend/pages/2_Translate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

import streamlit as st
import requests
import logging
Expand All @@ -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 ""
Expand Down
12 changes: 7 additions & 5 deletions frontend/requirements_frontend.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions requirements-frontend.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# fe-requirements.in
python-dotenv
streamlit
streamlit_extras
streamlit>=1.28.2
streamlit_extras>=0.3.5
watchdog
requests
pipdeptree

0 comments on commit 85a0301

Please sign in to comment.