KvrParaskevi commited on
Commit
ca9137b
1 Parent(s): e2156a2

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +2 -2
chatbot.py CHANGED
@@ -46,7 +46,7 @@ def load_pipeline():
46
  pipe = pipeline("text-generation",
47
  model= model,
48
  tokenizer = tokenizer,
49
- max_new_tokens = 20,
50
  top_k = 30,
51
  early_stopping=True,
52
  num_beams = 2,
@@ -78,4 +78,4 @@ def demo_chain(input_text,history):
78
  )
79
 
80
  chat_reply = conversation.invoke(input=input_text, max_new_tokens = 100)
81
- return chat_reply
 
46
  pipe = pipeline("text-generation",
47
  model= model,
48
  tokenizer = tokenizer,
49
+ max_new_tokens = 50,
50
  top_k = 30,
51
  early_stopping=True,
52
  num_beams = 2,
 
78
  )
79
 
80
  chat_reply = conversation.invoke(input=input_text, max_new_tokens = 100)
81
+ return chat_reply['response'].split('AI:')[-1]