This
Browse files- app.py +7 -11
- requirements.txt +1 -2
app.py
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
-
from
|
| 4 |
-
|
| 5 |
-
uri = os.environ["MONGO_CONNECTION_STRING"]
|
| 6 |
-
client = MongoClient(uri, tlsCertificateKeyFile="database/cert.pem")
|
| 7 |
-
db = client["testing"]
|
| 8 |
-
col = db["new"]
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
xyz = { "message":"This is new code"}
|
| 12 |
-
col.insert_one(xyz)
|
| 13 |
-
|
| 14 |
|
| 15 |
|
|
|
|
|
|
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
+
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
+
fill_masker = pipeline(model="bert-base-uncased")
|
| 7 |
+
# fill_masker("This is a simple [MASK].")
|
| 8 |
|
| 9 |
+
if query := st.chat_input("filler: "):
|
| 10 |
+
ans = fill_masker(f"[MASK]{query}[MASK]")
|
| 11 |
+
with st.chat_message("User"):
|
| 12 |
+
st.write(ans)
|
requirements.txt
CHANGED
|
@@ -1,3 +1,2 @@
|
|
| 1 |
streamlit
|
| 2 |
-
|
| 3 |
-
dnspython
|
|
|
|
| 1 |
streamlit
|
| 2 |
+
transformers[torch]
|
|
|