kamau1 commited on
Commit
eda3bd5
·
verified ·
1 Parent(s): 710fb48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -31,7 +31,7 @@ Public_Url = 'https://lewiskimaru-helloworld.hf.space/' #endpoint
31
 
32
  def translate(userinput, target_lang, source_lang=None):
33
  if source_lang:
34
- url = "Public_Url/translate_enter/"
35
  data = {
36
  "userinput": userinput,
37
  "source_lang": source_lang,
@@ -44,7 +44,7 @@ def translate(userinput, target_lang, source_lang=None):
44
  translation = result['translated_text']
45
  return source_lange, translation
46
  else:
47
- url = "Public_Url/translate_detect/"
48
  data = {
49
  "userinput": userinput,
50
  "target_lang": target_lang,
@@ -99,6 +99,17 @@ def get_conversation_chain(vectorstore:FAISS) -> ConversationalRetrievalChain:
99
  )
100
  return conversation_chain
101
 
 
 
 
 
 
 
 
 
 
 
 
102
  def main():
103
  st.title("SemaNaPDF📚")
104
  # upload file
 
31
 
32
  def translate(userinput, target_lang, source_lang=None):
33
  if source_lang:
34
+ url = f"{Public_Url}/translate_enter/"
35
  data = {
36
  "userinput": userinput,
37
  "source_lang": source_lang,
 
44
  translation = result['translated_text']
45
  return source_lange, translation
46
  else:
47
+ url = f"{Public_Url}/translate_detect/"
48
  data = {
49
  "userinput": userinput,
50
  "target_lang": target_lang,
 
99
  )
100
  return conversation_chain
101
 
102
+
103
+ st.markdown("""
104
+ <style>
105
+ div.stSpinner> {
106
+ text-align:center;
107
+ align-items: center;
108
+ justify-content: center;
109
+ }div
110
+ </style>""", unsafe_allow_html=True)
111
+
112
+
113
  def main():
114
  st.title("SemaNaPDF📚")
115
  # upload file