Shaltiel commited on
Commit
5dc9d4c
1 Parent(s): 33a5457

Fixed spacing

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -18,8 +18,8 @@ def clear_session() -> History:
18
  def history_to_messages(history: History) -> Messages:
19
  messages = []
20
  for h in history:
21
- messages.append({'role': 'user', 'content': h[0]})
22
- messages.append({'role': 'assistant', 'content': h[1]})
23
  return messages
24
 
25
  def messages_to_history(messages: Messages) -> Tuple[str, History]:
@@ -34,7 +34,7 @@ def model_chat(query: Optional[str], history: Optional[History]) -> Generator[Tu
34
  if history is None:
35
  history = []
36
  messages = history_to_messages(history)
37
- messages.append({'role': 'user', 'content': query})
38
  gen = oai_client.chat.completions.create(
39
  model='dicta-il/dictalm2.0-instruct',
40
  messages=messages,
 
18
  def history_to_messages(history: History) -> Messages:
19
  messages = []
20
  for h in history:
21
+ messages.append({'role': 'user', 'content': h[0].strip()})
22
+ messages.append({'role': 'assistant', 'content': h[1].strip()})
23
  return messages
24
 
25
  def messages_to_history(messages: Messages) -> Tuple[str, History]:
 
34
  if history is None:
35
  history = []
36
  messages = history_to_messages(history)
37
+ messages.append({'role': 'user', 'content': query.strip()})
38
  gen = oai_client.chat.completions.create(
39
  model='dicta-il/dictalm2.0-instruct',
40
  messages=messages,