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

Llama-2-chat integration #9

Closed
wants to merge 30 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c004d7b
llama-2-chat integration [wip]
eryk-dsai Aug 31, 2023
3337d6a
fixing problem with private pipeline
eryk-dsai Aug 31, 2023
26e10fc
_generate returns ChatResult
eryk-dsai Sep 1, 2023
2aba4cd
batch calls example in notebook, handling chat messages
eryk-dsai Sep 1, 2023
82f71f1
_format_messages_as_text docstring
eryk-dsai Sep 1, 2023
933f5f4
you can pass stop words now
eryk-dsai Sep 1, 2023
36519e0
format_messages_as_text test
eryk-dsai Sep 1, 2023
9a92e08
formatter
eryk-dsai Sep 1, 2023
cc53251
fix lint issues
eryk-dsai Sep 1, 2023
6a0cd87
removal of redundant notebook cell
eryk-dsai Sep 1, 2023
cc578b5
refactor: update naming to indicate Hugging Face usage
eryk-dsai Sep 4, 2023
cb33d48
small refactor
eryk-dsai Sep 4, 2023
440571d
fix lint errors, running formatter
eryk-dsai Sep 4, 2023
f860326
moving stopping criteria class out of function, correct typing
eryk-dsai Sep 4, 2023
9b6e79d
code review suggestions
eryk-dsai Sep 4, 2023
900d55c
run formatter and lint
eryk-dsai Sep 4, 2023
3b9c030
StoppingCriteria are correctly placed on the same device as pipeline
eryk-dsai Sep 5, 2023
9715b81
Merge branch 'llama2-chat' of https://github.com/deepsense-ai/langcha…
eryk-dsai Sep 5, 2023
3885de5
run formatter, lint
eryk-dsai Sep 5, 2023
814131d
removal of the redundant notebook cell
eryk-dsai Sep 5, 2023
bd6e2fe
moved StoppingCriteria import to method
eryk-dsai Sep 5, 2023
35b5e09
fixing type annotation
eryk-dsai Sep 5, 2023
1228bfc
fixing Enum tests
eryk-dsai Sep 5, 2023
926c02f
Editing the huggingface llama 2 notebook
eryk-dsai Sep 5, 2023
8a8a03a
Merge branch 'master' into llama2-chat
eryk-dsai Sep 5, 2023
964b579
typos, better name for customg Stopping Critieria subclass
eryk-dsai Sep 13, 2023
87597a1
Generic Hugging Face Pipeline Chat Model
eryk-dsai Sep 13, 2023
7756700
Merge branch 'langchain-ai:master' into llama2-chat
eryk-dsai Oct 6, 2023
d9e9ef3
simplifying HF Chat Model, by making use of HF Chat Templates
eryk-dsai Oct 10, 2023
cf203b9
removing incorrect check from validate_environment method
eryk-dsai Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions libs/langchain/langchain/chat_models/huggingface_llama2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from enum import Enum
from typing import Any, Dict, List, Optional, Union

from transformers.pipelines import TextGenerationPipeline

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could have if type_checking - as it is done for other places.


from langchain.callbacks.manager import (
CallbackManagerForLLMRun,
)
Expand Down Expand Up @@ -36,7 +34,7 @@ def __str__(self) -> str:


class ChatLlama2Hf(BaseChatModel):
pipeline: TextGenerationPipeline
pipeline: Any

@property
def _llm_type(self) -> str:
Expand Down