KvrParaskevi
commited on
Update chatbot.py
Browse files- chatbot.py +3 -3
chatbot.py
CHANGED
@@ -7,7 +7,7 @@ from langchain_community.llms.huggingface_pipeline import HuggingFacePipeline
|
|
7 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, pipeline
|
8 |
#import streamlit as st
|
9 |
|
10 |
-
my_model_id =
|
11 |
token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
12 |
|
13 |
template = """<<SYS>>
|
@@ -64,11 +64,11 @@ def demo_miny_memory():
|
|
64 |
memory = ConversationBufferMemory(memory_key="chat_history", llm = llm)
|
65 |
return memory
|
66 |
|
67 |
-
def demo_chain(input_text):
|
68 |
conversation = ConversationChain(
|
69 |
llm=llm,
|
70 |
verbose=True,
|
71 |
-
memory=
|
72 |
)
|
73 |
|
74 |
chat_reply = conversation(input=input_text)
|
|
|
7 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, pipeline
|
8 |
#import streamlit as st
|
9 |
|
10 |
+
my_model_id = os.getenv('MODEL_REPO_ID', 'Default Value')
|
11 |
token = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
12 |
|
13 |
template = """<<SYS>>
|
|
|
64 |
memory = ConversationBufferMemory(memory_key="chat_history", llm = llm)
|
65 |
return memory
|
66 |
|
67 |
+
def demo_chain(input_text, memory):
|
68 |
conversation = ConversationChain(
|
69 |
llm=llm,
|
70 |
verbose=True,
|
71 |
+
memory=memory
|
72 |
)
|
73 |
|
74 |
chat_reply = conversation(input=input_text)
|