import streamlit as st from datasets import load_dataset from transformers import pipeline # Título de la aplicación st.title("Chatbot y Análisis de Criptomonedas con Hugging Face") # Cargar el modelo de chatbot avanzado (DialoGPT español) chatbot = pipeline("conversational", model="ITG/DialoGPT-medium-spanish-chitchat") # Interacción con el chatbot st.header("Chat con el Bot") user_input = st.text_input("Escribe tu mensaje:") if st.button("Enviar"): if user_input: response = chatbot(user_input) st.write(f"Bot: {response[0]['generated_text']}") else: st.write("Por favor, escribe un mensaje.") # Análisis de Criptomonedas usando un Dataset de Hugging Face st.header("Análisis de Criptomonedas") st.write(""" Este análisis se realiza con el conjunto de datos `crypto_data` de Hugging Face para el análisis histórico de precios de criptomonedas. """) # Cargar el dataset de criptomonedas crypto_data = load_dataset("sebdg/crypto_data") # Mostrar datos de ejemplo del dataset st.write("Dataset de Criptomonedas cargado:") st.write(crypto_data['train'].head())