codingwithadi commited on
Commit
eea09fd
·
verified ·
1 Parent(s): be820ad

Upload openmark/ui/app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. openmark/ui/app.py +3 -4
openmark/ui/app.py CHANGED
@@ -30,8 +30,7 @@ def chat_fn(message: str, history: list, thread_id: str):
30
  if not message.strip():
31
  return history, ""
32
  response = ask(_agent, message, thread_id=thread_id or "default")
33
- history.append({"role": "user", "content": message})
34
- history.append({"role": "assistant", "content": response})
35
  return history, ""
36
 
37
 
@@ -101,7 +100,7 @@ def stats_fn():
101
  def build_ui():
102
  categories = ["All"] + config.CATEGORIES
103
 
104
- with gr.Blocks(title="OpenMark", theme=gr.themes.Soft()) as app:
105
  gr.Markdown("# OpenMark — Your Personal Knowledge Graph")
106
 
107
  with gr.Tabs():
@@ -109,7 +108,7 @@ def build_ui():
109
  # Tab 1: Chat
110
  with gr.Tab("Chat"):
111
  thread = gr.Textbox(value="default", label="Session ID", scale=1)
112
- chatbot = gr.Chatbot(type="messages", height=500)
113
  msg_box = gr.Textbox(
114
  placeholder="Ask anything about your saved bookmarks...",
115
  label="Message", lines=2,
 
30
  if not message.strip():
31
  return history, ""
32
  response = ask(_agent, message, thread_id=thread_id or "default")
33
+ history.append((message, response))
 
34
  return history, ""
35
 
36
 
 
100
  def build_ui():
101
  categories = ["All"] + config.CATEGORIES
102
 
103
+ with gr.Blocks(title="OpenMark") as app:
104
  gr.Markdown("# OpenMark — Your Personal Knowledge Graph")
105
 
106
  with gr.Tabs():
 
108
  # Tab 1: Chat
109
  with gr.Tab("Chat"):
110
  thread = gr.Textbox(value="default", label="Session ID", scale=1)
111
+ chatbot = gr.Chatbot(height=500)
112
  msg_box = gr.Textbox(
113
  placeholder="Ask anything about your saved bookmarks...",
114
  label="Message", lines=2,