Download app.py from MORENdi/flowise: direct link, hf CLI and curl.
- Browser
- Download file 935 Bytes
-
https://huggingface.co/spaces/MORENdi/flowise/resolve/main/app.py
- Command line
-
hf download hf://spaces/MORENdi/flowise/app.py
-
curl -L -o app.py https://huggingface.co/spaces/MORENdi/flowise/resolve/main/app.py
935 Bytes
| import streamlit as st | |
| from transformers import pipeline # Или другой способ загрузки вашей модели | |
| # Загрузка модели (один раз при запуске приложения) | |
| def load_model(): | |
| return pipeline("text-generation", model="DeepPavlov/rubert-base-cased-conversational") | |
| # Обработка текста | |
| def process_text_with_model(text): | |
| # Логика для обработки текста с помощью вашей модели | |
| # Пример: | |
| generator = load_model() | |
| response = generator(text, max_length=100, num_return_sequences=1)[0]['generated_text'] | |
| return response | |
| # Интерфейс Streamlit | |
| st.title("Чат-бот по \"Аленькому цветочку\"") | |
| user_input = st.text_input("Введите ваш вопрос:") | |
| if user_input: | |
| response = process_text_with_model(user_input) | |
| st.write(response) |