gofeco commited on
Commit
de3cc67
1 Parent(s): 5204ea7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -5,9 +5,15 @@ from langchain_community.embeddings.sentence_transformer import SentenceTransfor
5
  from langchain_community.vectorstores import Chroma
6
  import streamlit as st
7
 
8
- embedding_function = SentenceTransformerEmbeddings(model_name="all-mpnet-base-v2")
9
- chdb = Chroma(persist_directory="./chroma_db_info", embedding_function=embedding_function)
10
-
 
 
 
 
 
 
11
  query = st.text_input("Enter a query")
12
  disnum = 3
13
  if query:
 
5
  from langchain_community.vectorstores import Chroma
6
  import streamlit as st
7
 
8
+ lang = st.radio("Choose Language:",
9
+ ["English", "中文"])
10
+ if lang == "English":
11
+ embedding_function = SentenceTransformerEmbeddings(model_name="all-mpnet-base-v2")
12
+ chdb = Chroma(persist_directory="./chroma_db_info", embedding_function=embedding_function)
13
+ else:
14
+ embedding_function = SentenceTransformerEmbeddings(model_name="shibing624/text2vec-base-chinese")
15
+ chdb = Chroma(persist_directory="./chroma_db_ch", embedding_function=embedding_function)
16
+
17
  query = st.text_input("Enter a query")
18
  disnum = 3
19
  if query: