johann22 commited on
Commit
7d0b562
1 Parent(s): cf6a900

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -16,9 +16,9 @@ def format_prompt(message, history):
16
  return prompt
17
 
18
  def generate(
19
- prompt, history, system_prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0,
20
  ):
21
- system_prompt=prompts.WEB_DEV
22
  temperature = float(temperature)
23
  if temperature < 1e-2:
24
  temperature = 1e-2
@@ -41,7 +41,10 @@ def generate(
41
  output += response.token.text
42
  yield output
43
  return output
44
-
 
 
 
45
 
46
  additional_inputs=[
47
  gr.Textbox(
@@ -85,12 +88,11 @@ additional_inputs=[
85
  step=0.05,
86
  interactive=True,
87
  info="Penalize repeated tokens",
88
- )
89
- ]
90
- agents =[
91
- "WEB_DEV",
92
- "AI_SYSTEM_PROMPT",
93
  ]
 
94
  examples=[["I'm planning a vacation to Japan. Can you suggest a one-week itinerary including must-visit places and local cuisines to try?", None, None, None, None, None, ],
95
  ["Can you write a short story about a time-traveling detective who solves historical mysteries?", None, None, None, None, None,],
96
  ["I'm trying to learn French. Can you provide some common phrases that would be useful for a beginner, along with their pronunciations?", None, None, None, None, None,],
@@ -108,6 +110,5 @@ with gr.Blocks() as iface:
108
  examples=examples,
109
  concurrency_limit=20,
110
  )
111
- ag = gr.Dropdown(choices=[s for s in agents])
112
  iface.launch(show_api=False)
113
 
 
16
  return prompt
17
 
18
  def generate(
19
+ prompt, history, system_prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0, agent=None,
20
  ):
21
+ system_prompt=prompts.{agent}
22
  temperature = float(temperature)
23
  if temperature < 1e-2:
24
  temperature = 1e-2
 
41
  output += response.token.text
42
  yield output
43
  return output
44
+ agents =[
45
+ "WEB_DEV",
46
+ "AI_SYSTEM_PROMPT",
47
+ ]
48
 
49
  additional_inputs=[
50
  gr.Textbox(
 
88
  step=0.05,
89
  interactive=True,
90
  info="Penalize repeated tokens",
91
+ ),
92
+ gr.Dropdown(choices=[s for s in agents]),
93
+
 
 
94
  ]
95
+
96
  examples=[["I'm planning a vacation to Japan. Can you suggest a one-week itinerary including must-visit places and local cuisines to try?", None, None, None, None, None, ],
97
  ["Can you write a short story about a time-traveling detective who solves historical mysteries?", None, None, None, None, None,],
98
  ["I'm trying to learn French. Can you provide some common phrases that would be useful for a beginner, along with their pronunciations?", None, None, None, None, None,],
 
110
  examples=examples,
111
  concurrency_limit=20,
112
  )
 
113
  iface.launch(show_api=False)
114