Spaces:
Sleeping
Sleeping
Commit ·
77152c8
1
Parent(s): 0b9bdd3
first attempt of chatbot
Browse files- requirements.txt +8 -1
- src/streamlit_app.py +8 -1
requirements.txt
CHANGED
|
@@ -1,3 +1,10 @@
|
|
| 1 |
altair
|
| 2 |
pandas
|
| 3 |
-
streamlit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
altair
|
| 2 |
pandas
|
| 3 |
+
streamlit
|
| 4 |
+
transformers
|
| 5 |
+
accelerate
|
| 6 |
+
torch
|
| 7 |
+
ipykernel
|
| 8 |
+
langchain
|
| 9 |
+
langchain-huggingface
|
| 10 |
+
huggingface_hub
|
src/streamlit_app.py
CHANGED
|
@@ -2,6 +2,7 @@ import altair as alt
|
|
| 2 |
import numpy as np
|
| 3 |
import pandas as pd
|
| 4 |
import streamlit as st
|
|
|
|
| 5 |
|
| 6 |
"""
|
| 7 |
# Bienvenido a tu Tutor IA
|
|
@@ -13,7 +14,7 @@ Puedes hacer preguntas, resolver problemas y recibir explicaciones detalladas so
|
|
| 13 |
|
| 14 |
"""
|
| 15 |
|
| 16 |
-
st.title("Bienvenido a tu Tutor IA. ¡Espero que hoy estés lleno de curiosidad y ganas de aprender
|
| 17 |
|
| 18 |
if "messages" not in st.session_state:
|
| 19 |
st.session_state.messages = []
|
|
@@ -35,5 +36,11 @@ if prompt := st.chat_input("What is up?"):
|
|
| 35 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 36 |
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import pandas as pd
|
| 4 |
import streamlit as st
|
| 5 |
+
from utils import ask_math_problem
|
| 6 |
|
| 7 |
"""
|
| 8 |
# Bienvenido a tu Tutor IA
|
|
|
|
| 14 |
|
| 15 |
"""
|
| 16 |
|
| 17 |
+
st.title("Bienvenido a tu Tutor IA. ¡Espero que hoy estés lleno de curiosidad y ganas de aprender!")
|
| 18 |
|
| 19 |
if "messages" not in st.session_state:
|
| 20 |
st.session_state.messages = []
|
|
|
|
| 36 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 37 |
|
| 38 |
|
| 39 |
+
with st.chat_message("assistant"):
|
| 40 |
+
st.spinner("Pensando...")
|
| 41 |
+
respuesta=ask_math_problem(prompt)
|
| 42 |
+
st.write(respuesta)
|
| 43 |
+
st.session_state.messages.append({"role": "assistant", "content": respuesta})
|
| 44 |
+
|
| 45 |
|
| 46 |
|