Spaces:
Sleeping
Sleeping
import streamlit as st | |
import requests | |
# Streamlit 页面设置 | |
st.title('AI Model API Interface') | |
st.write('输入文本,获取模型预测结果。') | |
# 用户输入 | |
user_input = st.text_area('请输入文本:') | |
if st.button('提交'): | |
if user_input.strip(): | |
with st.spinner('正在预测...'): | |
try: | |
prediction = user_input + '123' | |
st.success(f'预测结果: {prediction}') | |
except Exception as e: | |
st.error(f'请求失败: {e}') | |
else: | |
st.warning('请输入文本!') | |