davidberenstein1957 HF staff commited on
Commit
62bb2f6
Β·
1 Parent(s): cef916e

update messaging magpie requirements

Browse files
src/synthetic_dataset_generator/constants.py CHANGED
@@ -33,18 +33,21 @@ if BASE_URL != "https://api-inference.huggingface.co/v1/" and len(API_KEYS) == 0
33
  raise ValueError(
34
  "API_KEY is not set. Ensure you have set the API_KEY environment variable that has access to the Hugging Face Inference Endpoints."
35
  )
36
- if "Qwen2" not in MODEL and "Llama-3" not in MODEL:
 
 
 
 
 
 
 
 
 
37
  SFT_AVAILABLE = False
38
  warnings.warn(
39
- "SFT_AVAILABLE is set to False because the model is not a Qwen or Llama model."
40
  )
41
  MAGPIE_PRE_QUERY_TEMPLATE = None
42
- else:
43
- SFT_AVAILABLE = True
44
- if "Qwen2" in MODEL:
45
- MAGPIE_PRE_QUERY_TEMPLATE = "qwen2"
46
- else:
47
- MAGPIE_PRE_QUERY_TEMPLATE = "llama3"
48
 
49
  # Embeddings
50
  STATIC_EMBEDDING_MODEL = "minishlab/potion-base-8M"
 
33
  raise ValueError(
34
  "API_KEY is not set. Ensure you have set the API_KEY environment variable that has access to the Hugging Face Inference Endpoints."
35
  )
36
+
37
+ llama_options = ["llama3", "llama-3", "llama 3"]
38
+ qwen_options = ["qwen2", "qwen-2", "qwen 2"]
39
+ if MODEL.lower() in llama_options:
40
+ SFT_AVAILABLE = True
41
+ MAGPIE_PRE_QUERY_TEMPLATE = "llama3"
42
+ elif MODEL.lower() in qwen_options:
43
+ SFT_AVAILABLE = True
44
+ MAGPIE_PRE_QUERY_TEMPLATE = "qwen2"
45
+ else:
46
  SFT_AVAILABLE = False
47
  warnings.warn(
48
+ "`SFT_AVAILABLE` is set to `False` because the model is not a Qwen or Llama model."
49
  )
50
  MAGPIE_PRE_QUERY_TEMPLATE = None
 
 
 
 
 
 
51
 
52
  # Embeddings
53
  STATIC_EMBEDDING_MODEL = "minishlab/potion-base-8M"