Spaces:
Sleeping
Sleeping
Commit ·
7a47212
1
Parent(s): ac3d570
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,14 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
-
from PIL import Image
|
| 4 |
|
| 5 |
-
pipeline = pipeline(task="
|
| 6 |
|
| 7 |
-
st.title("
|
| 8 |
|
| 9 |
-
|
| 10 |
|
| 11 |
-
if
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
predictions = pipeline(image)
|
| 17 |
-
|
| 18 |
-
col2.header("Probabilities")
|
| 19 |
-
for p in predictions:
|
| 20 |
-
col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
|
|
|
| 3 |
|
| 4 |
+
pipeline = pipeline(task="conversational", model="lmsys/fastchat-t5-3b-v1.0")
|
| 5 |
|
| 6 |
+
st.title("Conversational AI with FastChat")
|
| 7 |
|
| 8 |
+
query = st.text_input("Enter your query:")
|
| 9 |
|
| 10 |
+
if query is not None:
|
| 11 |
+
response = pipeline(query)
|
| 12 |
|
| 13 |
+
st.subheader("Response:")
|
| 14 |
+
st.write(response["text"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|