julienlesbegueries commited on
Commit
bfa4647
1 Parent(s): 25aaa11
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -31,10 +31,14 @@ def print_like_dislike(x: gr.LikeData):
31
 
32
  def add_ia_text(history, text):
33
  messages.append({"role": "user", "content": text})
34
- # prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
35
- # outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
36
- response =
37
- history = history + [(outputs[0]["generated_text"]), None] # type: ignore
 
 
 
 
38
 
39
 
40
  def add_text(history, text):
 
31
 
32
  def add_ia_text(history, text):
33
  messages.append({"role": "user", "content": text})
34
+ print(messages)
35
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
36
+ print("prompt")
37
+ outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
38
+ print("output")
39
+ response = (outputs[0]["generated_text"])# type: ignore
40
+ print(response)
41
+ history = history + [response, None]
42
 
43
 
44
  def add_text(history, text):