-
Notifications
You must be signed in to change notification settings - Fork 277
Open
Labels
Mercury-Version-3New version of MercuryNew version of Mercury
Description
Scroll is going down when I add a new message, but when new content is appended the scroll is not scrolling ...
Here is my demo
import ollama
import mercury as mr
messages = []
chat = mr.Chat(placeholder="💬 Brak wiadomości, zacznij konwersację")
prompt = mr.ChatInput(placeholder="Napisz wiadomość ...")
if prompt.value:
usr_msg = mr.Message(markdown=prompt.value, role="user")
chat.add(usr_msg)
messages += [{'role': 'user', 'content': prompt.value}]
# 🇵🇱 local LLM
stream = ollama.chat(
model='SpeakLeash/bielik-11b-v3.0-instruct:Q4_K_M',
messages=messages,
stream=True,
)
ai_msg = mr.Message(role="assistant", emoji="🦅")
chat.add(ai_msg)
content = ""
for chunk in stream:
ai_msg.append_markdown(chunk.message.content)
content += chunk.message.content
messages += [{'role': 'assistant', 'content': content}]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Mercury-Version-3New version of MercuryNew version of Mercury