alfraser commited on
Commit
20cff9b
·
1 Parent(s): 7c479ac

Added another test prompt format

Browse files
config/architectures.json CHANGED
@@ -67,6 +67,15 @@
67
  {"class": "HFInferenceEndpoint", "params": {"endpoint_url": "https://d0on8skmq6t2a4wo.eu-west-1.aws.endpoints.huggingface.cloud","model_name": "Fine-Tuned Meta Llama 2 chat", "system_prompt": "You are a helpful domestic appliance advisor for the ElectroHome company. Please answer customer questions and do not mention other brands. If you cannot answer please say so.", "max_new_tokens": 1000, "prompt_style": "single_line_no_sys"}},
68
  {"class": "OutputResponseScreener"}
69
  ]
 
 
 
 
 
 
 
 
 
70
  }
71
  ]
72
  }
 
67
  {"class": "HFInferenceEndpoint", "params": {"endpoint_url": "https://d0on8skmq6t2a4wo.eu-west-1.aws.endpoints.huggingface.cloud","model_name": "Fine-Tuned Meta Llama 2 chat", "system_prompt": "You are a helpful domestic appliance advisor for the ElectroHome company. Please answer customer questions and do not mention other brands. If you cannot answer please say so.", "max_new_tokens": 1000, "prompt_style": "single_line_no_sys"}},
68
  {"class": "OutputResponseScreener"}
69
  ]
70
+ },
71
+ {
72
+ "name": "8. Fine-tuning test 2 - multi_line_with_roles",
73
+ "description": "Fine-tuning to try different training methods",
74
+ "steps": [
75
+ {"class": "InputRequestScreener"},
76
+ {"class": "HFInferenceEndpoint", "params": {"endpoint_url": "https://d0on8skmq6t2a4wo.eu-west-1.aws.endpoints.huggingface.cloud","model_name": "Fine-Tuned Meta Llama 2 chat", "system_prompt": "You are a helpful domestic appliance advisor for the ElectroHome company. Please answer customer questions and do not mention other brands. If you cannot answer please say so.", "max_new_tokens": 1000, "prompt_style": "multi_line_with_roles"}},
77
+ {"class": "OutputResponseScreener"}
78
+ ]
79
  }
80
  ]
81
  }
src/architectures.py CHANGED
@@ -477,6 +477,8 @@ class HFInferenceEndpoint(ArchitectureComponent):
477
  query_input = f"<s>[INST] {request.request} [/INST] "
478
  elif self.prompt_style == "single_line":
479
  query_input = f"<s>[INST] <<SYS>>\n{self.system_prompt}\n<</SYS>> {request.request} [/INST] "
 
 
480
  else:
481
  raise ValueError(f"Config error - Unknown prompt style: {self.prompt_style}")
482
  payload = {
 
477
  query_input = f"<s>[INST] {request.request} [/INST] "
478
  elif self.prompt_style == "single_line":
479
  query_input = f"<s>[INST] <<SYS>>\n{self.system_prompt}\n<</SYS>> {request.request} [/INST] "
480
+ elif self.prompt_style == "multi_line_with_roles":
481
+ query_input = f"<<SYS>>\n{self.system_prompt}\n<</SYS>>\n[INST]\nUser:{request.request}\n[/INST]\n\nAssistant:"
482
  else:
483
  raise ValueError(f"Config error - Unknown prompt style: {self.prompt_style}")
484
  payload = {