Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,8 @@ anyscale_base_url = "https://api.endpoints.anyscale.com/v1"
|
|
| 8 |
multilingual_embeddings = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="jost/multilingual-e5-base-politics-de")
|
| 9 |
|
| 10 |
def predict(api_key, user_input, model1, model2, prompt_manipulation=None, direct_steering_option=None):
|
|
|
|
|
|
|
| 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"})
|
|
@@ -86,7 +88,7 @@ def main():
|
|
| 86 |
output1 = gr.Textbox(label="Model 1 Response")
|
| 87 |
output2 = gr.Textbox(label="Model 2 Response")
|
| 88 |
|
| 89 |
-
submit_btn.click(fn=predict, inputs=[api_key_input, user_input, model_selector1, model_selector2], outputs=[output1, output2])
|
| 90 |
|
| 91 |
demo.launch()
|
| 92 |
|
|
|
|
| 8 |
multilingual_embeddings = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="jost/multilingual-e5-base-politics-de")
|
| 9 |
|
| 10 |
def predict(api_key, user_input, model1, model2, prompt_manipulation=None, direct_steering_option=None):
|
| 11 |
+
print(prompt_manipulation)
|
| 12 |
+
print(direct_steering_option)
|
| 13 |
# client = chromadb.PersistentClient(path="./manifesto-database")
|
| 14 |
# manifesto_collection = client.get_or_create_collection(name="manifesto-database", embedding_function=multilingual_embeddings)
|
| 15 |
# retrieved_context = manifesto_collection.query(query_texts=[user_input], n_results=3, where={"ideology": "Authoritarian-right"})
|
|
|
|
| 88 |
output1 = gr.Textbox(label="Model 1 Response")
|
| 89 |
output2 = gr.Textbox(label="Model 2 Response")
|
| 90 |
|
| 91 |
+
submit_btn.click(fn=predict, inputs=[api_key_input, user_input, model_selector1, model_selector2, prompt_manipulation, direct_steering_option], outputs=[output1, output2])
|
| 92 |
|
| 93 |
demo.launch()
|
| 94 |
|