KvrParaskevi
commited on
Update chatbot.py
Browse files- chatbot.py +7 -3
chatbot.py
CHANGED
@@ -48,8 +48,12 @@ def load_pipeline():
|
|
48 |
pipe = pipeline("text-generation",
|
49 |
model= model,
|
50 |
tokenizer = tokenizer,
|
51 |
-
max_new_tokens = 252,
|
52 |
-
|
|
|
|
|
|
|
|
|
53 |
|
54 |
llm = HuggingFacePipeline(pipeline = pipe)
|
55 |
return llm
|
@@ -73,5 +77,5 @@ def demo_chain(input_text, memory):
|
|
73 |
memory=memory
|
74 |
)
|
75 |
|
76 |
-
chat_reply = conversation.
|
77 |
return chat_reply
|
|
|
48 |
pipe = pipeline("text-generation",
|
49 |
model= model,
|
50 |
tokenizer = tokenizer,
|
51 |
+
max_new_tokens = 252,
|
52 |
+
top_k = 30,
|
53 |
+
early_stopping=True,
|
54 |
+
num_beams =2,
|
55 |
+
temperature = 0.1,
|
56 |
+
repetition_penalty = 1.03)
|
57 |
|
58 |
llm = HuggingFacePipeline(pipeline = pipe)
|
59 |
return llm
|
|
|
77 |
memory=memory
|
78 |
)
|
79 |
|
80 |
+
chat_reply = conversation.invoke(input=input_text, max_new_tokens = 252)
|
81 |
return chat_reply
|