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

[Text Generation][KVCacheStorage] ChatPipeline implementation #1266

Merged
merged 22 commits into from
Sep 22, 2023

Conversation

dbogunowicz
Copy link
Contributor

@dbogunowicz dbogunowicz commented Sep 22, 2023

Implementation of ChatPipeline that builds on top of TextGenerationPipeline, but uses session_ids and StorageKVCache to enable continuous recollection of past kv_cache information.

Example use:

from deepsparse import Pipeline

pipeline = Pipeline.create(
    task="chat",
    model_path="/home/ubuntu/damian/sparseml/deployment_opt",
)
session_id = "session_id"
while True:
    # get input from user
    input_text = input("User: ")
    response = pipeline(sequences=[input_text], session_ids=session_id, max_tokens=32)
    print("Bot: ", response.generations[0].text)
User: Hi my name is Damian and I am from Italy.
Bot:   I am a professional photographer and I have been working in the industry for over 10 years. I have been working in the industry for the last 5 years and I
User: am from   
Bot:   Italy. I have been working in the industry for the last 5 years and I am from  Italy. I have been working in the industry for the last 5
User: Did I mention that my name is
Bot:   Damian?

I am a professional photographer and I have been working in the industry for the last 5 years and 

Testing:

  • successfully ran the full LLM testing suite

@dbogunowicz dbogunowicz changed the title Feature/damian/chat pipeline new [Text Generation][KVCacheStorage] ChatPipeline implementation Sep 22, 2023
@bfineran
Copy link
Contributor

error looks unrelated right now - merging

@bfineran bfineran merged commit 098d1db into main Sep 22, 2023
@bfineran bfineran deleted the feature/damian/chat_pipeline_new branch September 22, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants