johann22 commited on
Commit
0dbf789
1 Parent(s): 69bbea6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -14,9 +14,12 @@ def format_prompt(message, history):
14
  prompt += f" {bot_response}</s> "
15
  prompt += f"[INST] {message} [/INST]"
16
  return prompt
17
-
 
 
 
18
  def generate(
19
- prompt, history, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0, agent_name=None,
20
  ):
21
  if agent_name == "WEB_DEV":
22
  agent = prompt.WEB_DEV
@@ -45,14 +48,11 @@ def generate(
45
  output += response.token.text
46
  yield output
47
  return output
48
- agents =[
49
- "WEB_DEV",
50
- "AI_SYSTEM_PROMPT",
51
- ]
52
 
53
  additional_inputs=[
54
  gr.Textbox(
55
- label="Prompt",
56
  max_lines=1,
57
  interactive=True,
58
  ),
@@ -96,7 +96,7 @@ additional_inputs=[
96
  gr.Dropdown(
97
  label="Agents",
98
  choices=[s for s in agents],
99
- value=agent[0],
100
  interactive=True,
101
  ),
102
 
 
14
  prompt += f" {bot_response}</s> "
15
  prompt += f"[INST] {message} [/INST]"
16
  return prompt
17
+ agents =[
18
+ "WEB_DEV",
19
+ "AI_SYSTEM_PROMPT",
20
+ ]
21
  def generate(
22
+ prompt, history, sys_prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0, agent_name=agents[0],
23
  ):
24
  if agent_name == "WEB_DEV":
25
  agent = prompt.WEB_DEV
 
48
  output += response.token.text
49
  yield output
50
  return output
51
+
 
 
 
52
 
53
  additional_inputs=[
54
  gr.Textbox(
55
+ label="System Prompt",
56
  max_lines=1,
57
  interactive=True,
58
  ),
 
96
  gr.Dropdown(
97
  label="Agents",
98
  choices=[s for s in agents],
99
+ value=agents[0],
100
  interactive=True,
101
  ),
102