Spaces:
Sleeping
Sleeping
julienlesbegueries
commited on
Commit
•
bfa4647
1
Parent(s):
25aaa11
up
Browse files
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 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
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):
|