avilum commited on
Commit
54027b8
·
verified ·
1 Parent(s): bf9abac

Create common.py

Browse files
Files changed (1) hide show
  1. common.py +41 -0
common.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Embedding model name from HuggingFace
2
+ EMBEDDING_MODEL_NAME = "sentence-transformers/all-mpnet-base-v2"
3
+
4
+ # Embedding model kwargs
5
+ MODEL_KWARGS = {"device": "cpu"} # or "cuda"
6
+
7
+ # The similarity threshold in %
8
+ # where 1.0 is 100% "known threat" from the database.
9
+ # Any vectors found above this value will teigger an anomaly on the provided prompt.
10
+ SIMILARITY_ANOMALY_THRESHOLD = 0.1
11
+
12
+ # Number of prompts to retreive (TOP K)
13
+ K = 3
14
+
15
+ # Number of similar prompts to revreive before choosing TOP K
16
+ FETCH_K = 5
17
+
18
+ # The path of the dataset (to ingest)
19
+ DATASET_DIR = "/code/data/datasets/"
20
+ # DATASET_DIR = "../data/datasets/"
21
+ # DATASET_DIR = "/code/data/datasets/malicious_prompts/"
22
+ # DATASET_DIR = "../data/datasets/malicious_prompts/"
23
+ # DATASET_DIR = "/code/data/datasets/new_prompts_08_2024"
24
+
25
+
26
+ # The path of the vector store
27
+ # VECTORSTORE_FILENAME = "vectorstores/all"
28
+ # VECTORSTORE_FILENAME = "vectorstores/jailbreak_v_28k"
29
+ # VECTORSTORE_FILENAME = "vectorstores/malicious_prompts"
30
+ # VECTORSTORE_FILENAME = "vectorstores/malicious_prompts_chumk_200_overlap_100"
31
+ # VECTORSTORE_FILENAME = "vectorstores/malicious_prompts_chumk_200_overlap_100_2"
32
+ # VECTORSTORE_FILENAME = (
33
+ # "/code/data/vectorstores/malicious_prompts_knowledge_base"
34
+ # )
35
+ # VECTORSTORE_FILENAME = "../data/vectorstores/all_prompts"
36
+ # VECTORSTORE_FILENAME = "../data/vectorstores/best"
37
+ # VECTORSTORE_FILENAME = "/code/data/vectorstores/pliny-the-prompter-prompts"
38
+ VECTORSTORE_FILENAME = "/code/data/vectorstores/09-2024"
39
+ # VECTORSTORE_FILENAME = "../data/vectorstores/09-2024"
40
+
41
+ # VECTORSTORE_FILENAME = "/code/data/vectorstores/best"