Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download/upload chat messages to ChatInterface #5567

Open
ahuang11 opened this issue Oct 2, 2023 · 2 comments
Open

Add download/upload chat messages to ChatInterface #5567

ahuang11 opened this issue Oct 2, 2023 · 2 comments
Assignees
Labels
type: enhancement Minor feature or improvement to an existing feature

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Oct 2, 2023

I don't want to start the conversation from scratch so ideally, I can save a history of chat messages and re-upload it.

Or perhaps an easy way for users to add custom buttons to ChatInterface without dropping to ChatFeed, or even templates.

@ahuang11 ahuang11 added the TRIAGE Default label for untriaged issues label Oct 2, 2023
@ahuang11 ahuang11 changed the title Add download conversation / upload conversation Add download/upload chat messages to ChatInterface Oct 2, 2023
@philippjfr philippjfr added type: enhancement Minor feature or improvement to an existing feature and removed TRIAGE Default label for untriaged issues labels Oct 13, 2023
@ahuang11
Copy link
Contributor Author

ahuang11 commented Oct 14, 2023

Prior to this, I believe there should be an export / method method on ChatFeed that supports two formats:

  1. panel kwargs {"user": ..., "value": ..., "avatar": ...}
  2. openai / langchain style {"role": "system", "content": "You are a helpful bot."}

1 for saving and restoring from previous chat
2 for fine tuning and inference:

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")
chat = [
  {"role": "system", "content": "You are a helpful bot."},
  {"role": "user", "content": "Hello, how are you?"},
  {"role": "assistant", "content": "I'm doing great. How can I help you today?"},
  {"role": "user", "content": "I'd like to show off how chat templating works!"},
]

print(tokenizer.apply_chat_template(chat, tokenize=False))

Then maybe a third method, save which outputs a JSON file?

@ahuang11
Copy link
Contributor Author

cc: @MarcSkovMadsen for feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants