Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,6 @@ def query(payload):
|
|
14 |
return response.json(), response
|
15 |
|
16 |
|
17 |
-
|
18 |
-
|
19 |
context = "To extract information from documents, use sentence similarity task. To do sentiment analysis from tweets, use text classification task. To detect masks from images, use object detection task. To extract information from invoices, use named entity recognition from token classification task."
|
20 |
|
21 |
|
@@ -24,6 +22,11 @@ message_history = [{"text":"Let's find out the best task for your use case! Tell
|
|
24 |
|
25 |
for msg in message_history:
|
26 |
message(msg["text"], is_user = msg["is_user"]) # display all the previous message
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
placeholder = st.empty() # placeholder for latest message
|
29 |
|
@@ -32,10 +35,7 @@ with placeholder.container():
|
|
32 |
if last_message != "":
|
33 |
|
34 |
message(last_message["text"], last_message["is_user"]) # display the latest message
|
35 |
-
|
36 |
-
input = st.text_input("Ask me 🤗")
|
37 |
-
|
38 |
-
message_history.append({"text":input, "is_user" : True})
|
39 |
|
40 |
data, resp = query(
|
41 |
{
|
|
|
14 |
return response.json(), response
|
15 |
|
16 |
|
|
|
|
|
17 |
context = "To extract information from documents, use sentence similarity task. To do sentiment analysis from tweets, use text classification task. To detect masks from images, use object detection task. To extract information from invoices, use named entity recognition from token classification task."
|
18 |
|
19 |
|
|
|
22 |
|
23 |
for msg in message_history:
|
24 |
message(msg["text"], is_user = msg["is_user"]) # display all the previous message
|
25 |
+
|
26 |
+
input = st.text_input("Ask me 🤗")
|
27 |
+
|
28 |
+
message_history.append({"text":input, "is_user" : True})
|
29 |
+
|
30 |
|
31 |
placeholder = st.empty() # placeholder for latest message
|
32 |
|
|
|
35 |
if last_message != "":
|
36 |
|
37 |
message(last_message["text"], last_message["is_user"]) # display the latest message
|
38 |
+
|
|
|
|
|
|
|
39 |
|
40 |
data, resp = query(
|
41 |
{
|