shahtab commited on
Commit
bdfd174
Β·
1 Parent(s): 4b96fba

Update modules/utils.py

Browse files
Files changed (1) hide show
  1. modules/utils.py +6 -6
modules/utils.py CHANGED
@@ -15,13 +15,13 @@ class Utilities:
15
  """
16
  if os.path.exists(".env") and os.environ.get("OPENAI_API_KEY") is not None:
17
  user_api_key = os.environ["OPENAI_API_KEY"]
18
- st.sidebar.success("API key loaded from .env / .envμ—μ„œ λ‘œλ“œλœ API ν‚€", icon="πŸš€")
19
  else:
20
  user_api_key = st.sidebar.text_input(
21
- label="#### Your OpenAI API key / OpenAI API ν‚€ πŸ‘‡", placeholder="Paste your openAI API key, sk-", type="password"
22
  )
23
  if user_api_key:
24
- st.sidebar.success("API key loaded / API ν‚€κ°€ λ‘œλ“œλ˜μ—ˆμŠ΅λ‹ˆλ‹€", icon="πŸš€")
25
  return user_api_key
26
 
27
  @staticmethod
@@ -41,8 +41,8 @@ class Utilities:
41
  show_user_file(uploaded_file)
42
  else:
43
  st.sidebar.info(
44
- "πŸ‘† Upload your CSV file to get started, / μ‹œμž‘ν•˜λ €λ©΄ CSV νŒŒμΌμ„ μ—…λ‘œλ“œν•˜μ„Έμš” "
45
- "sample for try : / μ‹œλ„ν•΄ λ³Ό μƒ˜ν”Œ: [example.csv](https://drive.google.com/file/d/1g7x0Ydg5kr51Ha2XIYBSQBVUw1yYlgmc/view?usp=share_link)"
46
  )
47
  st.session_state["reset_chat"] = True
48
  return uploaded_file
@@ -53,7 +53,7 @@ class Utilities:
53
  Sets up the chatbot with the uploaded file, model, and temperature
54
  """
55
  embeds = Embedder()
56
- with st.spinner("Processing... / 처리 쀑..."):
57
  uploaded_file.seek(0)
58
  file = uploaded_file.read()
59
  vectors = embeds.getDocEmbeds(file, uploaded_file.name)
 
15
  """
16
  if os.path.exists(".env") and os.environ.get("OPENAI_API_KEY") is not None:
17
  user_api_key = os.environ["OPENAI_API_KEY"]
18
+ st.sidebar.success("API key loaded from .env ", icon="πŸš€")
19
  else:
20
  user_api_key = st.sidebar.text_input(
21
+ label="#### Your OpenAI API key / OpenAI API πŸ‘‡", placeholder="Paste your openAI API key, sk-", type="password"
22
  )
23
  if user_api_key:
24
+ st.sidebar.success("API key loaded ", icon="πŸš€")
25
  return user_api_key
26
 
27
  @staticmethod
 
41
  show_user_file(uploaded_file)
42
  else:
43
  st.sidebar.info(
44
+ "πŸ‘† Upload your CSV file to get started "
45
+ "sample for try : [example.csv](https://drive.google.com/file/d/1g7x0Ydg5kr51Ha2XIYBSQBVUw1yYlgmc/view?usp=share_link)"
46
  )
47
  st.session_state["reset_chat"] = True
48
  return uploaded_file
 
53
  Sets up the chatbot with the uploaded file, model, and temperature
54
  """
55
  embeds = Embedder()
56
+ with st.spinner("Processing..."):
57
  uploaded_file.seek(0)
58
  file = uploaded_file.read()
59
  vectors = embeds.getDocEmbeds(file, uploaded_file.name)