Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import transformers
|
|
| 3 |
import torch
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
-
|
| 7 |
|
| 8 |
|
| 9 |
|
|
@@ -54,7 +54,7 @@ if prompt := st.chat_input():
|
|
| 54 |
|
| 55 |
msg = tokenizer.decode(outputs[0]) #output[0]['generated_text']
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
|
| 60 |
# Display assistant response in chat message container
|
|
|
|
| 3 |
import torch
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
+
import re
|
| 7 |
|
| 8 |
|
| 9 |
|
|
|
|
| 54 |
|
| 55 |
msg = tokenizer.decode(outputs[0]) #output[0]['generated_text']
|
| 56 |
|
| 57 |
+
msg = re.sub(r'<.*?>', '', msg)
|
| 58 |
|
| 59 |
|
| 60 |
# Display assistant response in chat message container
|