jost commited on
Commit
d76dff5
·
verified ·
1 Parent(s): 374c901

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -10,6 +10,9 @@ multilingual_embeddings = embedding_functions.SentenceTransformerEmbeddingFuncti
10
  def predict(api_key, user_input):
11
  client = chromadb.PersistentClient(path="./manifesto-database")
12
  manifesto_collection = client.get_or_create_collection(name="manifesto-database", embedding_function=multilingual_embeddings)
 
 
 
13
 
14
  prompt = f"""[INST] {user_input} [/INST]"""
15
 
 
10
  def predict(api_key, user_input):
11
  client = chromadb.PersistentClient(path="./manifesto-database")
12
  manifesto_collection = client.get_or_create_collection(name="manifesto-database", embedding_function=multilingual_embeddings)
13
+ retrieved_context = manifesto_collection.query(query_texts=[user_input], n_results=3, where={"ideology": "Authoritarian-right"})
14
+ contexts = [context for context in retrieved_context['documents']]
15
+ print(contexts[0])
16
 
17
  prompt = f"""[INST] {user_input} [/INST]"""
18