Waflon commited on
Commit
ea7f6c8
1 Parent(s): 3c9dca8

Update modelo.py

Browse files
Files changed (1) hide show
  1. modelo.py +3 -2
modelo.py CHANGED
@@ -8,9 +8,10 @@ from langchain_openai import ChatOpenAI
8
  from langchain_community.vectorstores import FAISS
9
  from langchain_community.document_loaders import HuggingFaceDatasetLoader
10
  from langchain_community.embeddings import HuggingFaceEmbeddings
11
- os.environ["OPENAI_API_KEY"] = st.secrets['OPENAI_API_KEY'] # agregada en la config de hugginface
12
 
13
- def get_chain():
 
 
14
  #Embeddings que transforman a vectores densos multidimensionales las preguntas del SII
15
  embeddings = HuggingFaceEmbeddings(
16
  model_name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2", # Ruta a modelo Pre entrenado
 
8
  from langchain_community.vectorstores import FAISS
9
  from langchain_community.document_loaders import HuggingFaceDatasetLoader
10
  from langchain_community.embeddings import HuggingFaceEmbeddings
 
11
 
12
+
13
+ def get_chain(openai_key):
14
+ os.environ["OPENAI_API_KEY"] = openai_key # agregada en la config de hugginface
15
  #Embeddings que transforman a vectores densos multidimensionales las preguntas del SII
16
  embeddings = HuggingFaceEmbeddings(
17
  model_name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2", # Ruta a modelo Pre entrenado