Spaces:
Sleeping
Sleeping
Commit ·
c69f349
1
Parent(s): 41a2bec
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,14 @@
|
|
| 1 |
-
import
|
| 2 |
-
import
|
| 3 |
-
# from transformers import AutoModelForSeq2SeqLM
|
| 4 |
|
| 5 |
-
|
| 6 |
-
while True:
|
| 7 |
|
| 8 |
-
|
| 9 |
-
user_input = input("You: ")
|
| 10 |
|
| 11 |
-
|
| 12 |
-
model_response = model.generate(input_ids=torch.tensor([model.bos_token_id]).unsqueeze(0), prompt=user_input)
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 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"])
|