HFHAB commited on
Commit
ac96e13
·
verified ·
1 Parent(s): e41450f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +9 -1
main.py CHANGED
@@ -18,6 +18,14 @@ class Item(BaseModel):
18
  #repetition_penalty: float = 1.0
19
  #trust_remote_code = True
20
 
 
 
 
 
 
 
 
 
21
  def format_prompt(message, history):
22
  prompt = "<s>"
23
  for user_prompt, bot_response in history:
@@ -43,7 +51,7 @@ def generate(item: Item):
43
 
44
  #formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
45
  text = item.prompt
46
- #print(item.prompt)
47
  labels = ["Requirement", "Information"]
48
  stream = client.zero_shot_classification(text, labels)
49
  #stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
 
18
  #repetition_penalty: float = 1.0
19
  #trust_remote_code = True
20
 
21
+ #def format_prompt(message, history):
22
+ # prompt = "<s>"
23
+ # for user_prompt, bot_response in history:
24
+ # prompt += f"[INST] {user_prompt} [/INST]"
25
+ # prompt += f" {bot_response}</s> "
26
+ # prompt += f"[INST] {message} [/INST]"
27
+ # return prompt
28
+
29
  def format_prompt(message, history):
30
  prompt = "<s>"
31
  for user_prompt, bot_response in history:
 
51
 
52
  #formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
53
  text = item.prompt
54
+ print(item.prompt)
55
  labels = ["Requirement", "Information"]
56
  stream = client.zero_shot_classification(text, labels)
57
  #stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)