Update app.py
Browse files
app.py
CHANGED
|
@@ -11,17 +11,14 @@ pipe = pipeline(
|
|
| 11 |
|
| 12 |
def chat_fn(message, history):
|
| 13 |
history = history or []
|
| 14 |
-
prompt = message
|
| 15 |
-
|
| 16 |
outputs = pipe(
|
| 17 |
-
|
| 18 |
max_new_tokens=256,
|
| 19 |
do_sample=True,
|
| 20 |
temperature=0.7,
|
|
|
|
| 21 |
)
|
| 22 |
-
|
| 23 |
-
text = outputs[0]["generated_text"]
|
| 24 |
-
return text
|
| 25 |
|
| 26 |
demo = gr.ChatInterface(fn=chat_fn)
|
| 27 |
|
|
|
|
| 11 |
|
| 12 |
def chat_fn(message, history):
|
| 13 |
history = history or []
|
|
|
|
|
|
|
| 14 |
outputs = pipe(
|
| 15 |
+
message,
|
| 16 |
max_new_tokens=256,
|
| 17 |
do_sample=True,
|
| 18 |
temperature=0.7,
|
| 19 |
+
return_full_text=False,
|
| 20 |
)
|
| 21 |
+
return outputs[0]["generated_text"]
|
|
|
|
|
|
|
| 22 |
|
| 23 |
demo = gr.ChatInterface(fn=chat_fn)
|
| 24 |
|