SattamALMU commited on
Commit
c9bcfeb
1 Parent(s): 31e9213

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -23
app.py CHANGED
@@ -97,29 +97,8 @@ def respond(
97
  temperature,
98
  top_p,
99
  ):
100
- messages = [{"role": "system", "content": system_message}]
101
-
102
- for val in history:
103
- if val[0]:
104
- messages.append({"role": "user", "content": val[0]})
105
- if val[1]:
106
- messages.append({"role": "assistant", "content": val[1]})
107
-
108
- messages.append({"role": "user", "content": message})
109
-
110
- response = ""
111
-
112
- for message in client.chat_completion(
113
- messages,
114
- max_tokens=max_tokens,
115
- stream=True,
116
- temperature=temperature,
117
- top_p=top_p,
118
- ):
119
- token = message.choices[0].delta.content
120
-
121
- response += token
122
- yield response
123
 
124
  """
125
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
97
  temperature,
98
  top_p,
99
  ):
100
+ response = generate_answer(message)
101
+ yield response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  """
104
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface