KvrParaskevi commited on
Commit
7c912db
1 Parent(s): a09c475

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +4 -3
chatbot.py CHANGED
@@ -48,11 +48,12 @@ def load_pipeline():
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)
@@ -77,5 +78,5 @@ def demo_chain(input_text, memory):
77
  memory=memory
78
  )
79
 
80
- chat_reply = conversation.invoke(input=input_text, max_new_tokens = 252)
81
  return chat_reply["response"]
 
48
  pipe = pipeline("text-generation",
49
  model= model,
50
  tokenizer = tokenizer,
51
+ max_new_tokens = 20,
52
  top_k = 30,
53
  early_stopping=True,
54
+ num_beams = 2,
55
  temperature = 0.1,
56
+ top_p = 0.8,
57
  repetition_penalty = 1.03)
58
 
59
  llm = HuggingFacePipeline(pipeline = pipe)
 
78
  memory=memory
79
  )
80
 
81
+ chat_reply = conversation.invoke(input=input_text, max_new_tokens = 20)
82
  return chat_reply["response"]