Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

[Text Generation][KVCacheStorage] ChatPipeline implementation#1266

Merged
bfineran merged 22 commits into
mainfrom
feature/damian/chat_pipeline_new
Sep 22, 2023
Merged

[Text Generation][KVCacheStorage] ChatPipeline implementation#1266
bfineran merged 22 commits into
mainfrom
feature/damian/chat_pipeline_new

Conversation

@dbogunowicz

@dbogunowicz dbogunowicz commented Sep 22, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants