NotASI commited on
Commit
1f203a6
·
verified ·
1 Parent(s): c4df79e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -21,6 +21,8 @@ def respond(
21
  temperature,
22
  top_p,
23
  ):
 
 
24
  for val in history:
25
  if val[0]:
26
  messages.append({"role": "user", "content": val[0]})
@@ -32,12 +34,7 @@ def respond(
32
  response = ""
33
 
34
  stream = client.chat.completions.create(
35
- messages=[
36
- {
37
- "role": "user",
38
- "content": "Why is fast inference important?",
39
- }
40
- ],
41
  model=model_id,
42
  max_tokens=max_tokens,
43
  temperature=temperature,
@@ -52,6 +49,7 @@ def respond(
52
 
53
  chatbot = gr.ChatInterface(
54
  respond,
 
55
  additional_inputs=[
56
  gr.Dropdown(
57
  ["llama3.1-8b", "llama3.1-70b"],
 
21
  temperature,
22
  top_p,
23
  ):
24
+ messages = []
25
+
26
  for val in history:
27
  if val[0]:
28
  messages.append({"role": "user", "content": val[0]})
 
34
  response = ""
35
 
36
  stream = client.chat.completions.create(
37
+ messages=messages,
 
 
 
 
 
38
  model=model_id,
39
  max_tokens=max_tokens,
40
  temperature=temperature,
 
49
 
50
  chatbot = gr.ChatInterface(
51
  respond,
52
+ chatbot=gr.Chatbot(height=500),
53
  additional_inputs=[
54
  gr.Dropdown(
55
  ["llama3.1-8b", "llama3.1-70b"],