Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -3
src/streamlit_app.py
CHANGED
|
@@ -20,11 +20,13 @@ if st.button("Send"):
|
|
| 20 |
with st.spinner("Processing natively through the cluster..."):
|
| 21 |
try:
|
| 22 |
# 3. Route via internal endpoints rather than requests.post
|
| 23 |
-
|
| 24 |
-
prompt=user_input,
|
| 25 |
model="google/flan-t5-small",
|
| 26 |
-
|
|
|
|
| 27 |
)
|
|
|
|
|
|
|
| 28 |
answer = response.choices[0].message.content
|
| 29 |
st.success(answer)
|
| 30 |
|
|
|
|
| 20 |
with st.spinner("Processing natively through the cluster..."):
|
| 21 |
try:
|
| 22 |
# 3. Route via internal endpoints rather than requests.post
|
| 23 |
+
response = client.chat.completions.create(
|
|
|
|
| 24 |
model="google/flan-t5-small",
|
| 25 |
+
messages=[{"role": "user", "content": user_input}],
|
| 26 |
+
max_tokens=50
|
| 27 |
)
|
| 28 |
+
|
| 29 |
+
# 5. Extract output clean string text safely
|
| 30 |
answer = response.choices[0].message.content
|
| 31 |
st.success(answer)
|
| 32 |
|