dev2089 commited on
Commit
e110106
Β·
verified Β·
1 Parent(s): 50353bd

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -57,8 +57,7 @@ def chat(message, history, model):
57
  history = history or []
58
  prefix = {"Agni": "πŸ”₯ ", "Vayu": "🌊 ", "Akash": "🌌 "}.get(model, "πŸ”₯ ")
59
  response = get_response(message)
60
- history.append({"role": "user", "content": message})
61
- history.append({"role": "assistant", "content": prefix + response})
62
  return history, ""
63
 
64
  with gr.Blocks(title="Devrayog AI") as demo:
@@ -68,7 +67,7 @@ with gr.Blocks(title="Devrayog AI") as demo:
68
  with gr.Row():
69
  with gr.Column(scale=3):
70
  model = gr.Radio(["Agni", "Vayu", "Akash"], value="Agni", label="Model")
71
- chatbot = gr.Chatbot(height=350, show_label=False, type="messages")
72
  with gr.Row():
73
  msg = gr.Textbox(placeholder="Ask about SSB, NDA, TAT...", scale=4, container=False, autofocus=True)
74
  send = gr.Button("Send", scale=1, variant="primary")
 
57
  history = history or []
58
  prefix = {"Agni": "πŸ”₯ ", "Vayu": "🌊 ", "Akash": "🌌 "}.get(model, "πŸ”₯ ")
59
  response = get_response(message)
60
+ history.append((message, prefix + response))
 
61
  return history, ""
62
 
63
  with gr.Blocks(title="Devrayog AI") as demo:
 
67
  with gr.Row():
68
  with gr.Column(scale=3):
69
  model = gr.Radio(["Agni", "Vayu", "Akash"], value="Agni", label="Model")
70
+ chatbot = gr.Chatbot(height=350, show_label=False)
71
  with gr.Row():
72
  msg = gr.Textbox(placeholder="Ask about SSB, NDA, TAT...", scale=4, container=False, autofocus=True)
73
  send = gr.Button("Send", scale=1, variant="primary")