HFHAB commited on
Commit
180b31b
·
verified ·
1 Parent(s): e993f08

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +0 -9
main.py CHANGED
@@ -17,14 +17,6 @@ class Item(BaseModel):
17
  top_p: float = 0.15
18
  repetition_penalty: float = 1.0
19
 
20
- #def format_prompt(message, history):
21
- # prompt = "<s>"
22
- # for user_prompt, bot_response in history:
23
- # prompt += f"[INST] {user_prompt} [/INST]"
24
- # prompt += f" {bot_response}</s> "
25
- # prompt += f"[INST] {message} [/INST]"
26
- # return prompt
27
-
28
  def format_prompt(example):
29
  text = f"### Instruction: {example['input']}\n ### Response: {example['output']}"
30
  return text
@@ -44,7 +36,6 @@ def generate(item: Item):
44
  seed=42,
45
  )
46
 
47
- #formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
48
  formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}")
49
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
50
  output = ""
 
17
  top_p: float = 0.15
18
  repetition_penalty: float = 1.0
19
 
 
 
 
 
 
 
 
 
20
  def format_prompt(example):
21
  text = f"### Instruction: {example['input']}\n ### Response: {example['output']}"
22
  return text
 
36
  seed=42,
37
  )
38
 
 
39
  formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}")
40
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
41
  output = ""