Spaces:
Sleeping
Sleeping
File size: 540 Bytes
78449ed 5639dae 78449ed 79bcb8d 78449ed f1df981 78449ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import streamlit as st
from transformers import pipeline
# Charger un modèle accessible gratuitement
@st.cache_resource
def load_model():
return pipeline("text-generation", model="distilgpt2") # Modèle léger et libre d'accès
bot = load_model()
# Interface du chatbot
st.title("Chatbot Restaurant 🍽️")
st.write("Posez vos questions sur le restaurant !")
user_input = st.text_input("Votre question :")
if user_input:
response = bot(user_input, max_length=100, do_sample=True)[0]["generated_text"]
st.write(response) |