|
import streamlit as st |
|
|
|
from tool_loader import ToolLoader |
|
from app_user_desc import app_user_desc |
|
from app_dev_desc import app_dev_desc |
|
from logger import log_response |
|
from logger import log_enabled |
|
from app_chat import app_chat |
|
|
|
from app_agent_config import AgentConfig |
|
|
|
|
|
agent_config = AgentConfig() |
|
|
|
|
|
|
|
|
|
st.set_page_config( |
|
page_title="Transformers can realy do anything...", |
|
page_icon="π", |
|
) |
|
|
|
st.title("Hugging Face Agent and tools") |
|
|
|
|
|
|
|
st.markdown("Welcome to the Hugging Face Agent and Tools app! This app allows you to interact with various tools using the Hugging Face API.") |
|
|
|
|
|
|
|
import pandas as pd |
|
from io import StringIO |
|
with st.sidebar: |
|
|
|
uploaded_file = st.file_uploader("Choose a file") |
|
if uploaded_file is not None: |
|
|
|
bytes_data = uploaded_file.getvalue() |
|
st.write(bytes_data) |
|
|
|
|
|
stringio = StringIO(uploaded_file.getvalue().decode("utf-8")) |
|
st.write(stringio) |
|
|
|
|
|
string_data = stringio.read() |
|
st.write(string_data) |
|
|
|
|
|
dataframe = pd.read_csv(uploaded_file) |
|
st.write(dataframe) |
|
|
|
|
|
|
|
|
|
tabs = st.tabs(["Chat", "URL, Tools and logging", "User Description", "Developers"]) |
|
|
|
|
|
with tabs[0]: |
|
|
|
|
|
|
|
|
|
st.markdown("Stat to chat. e.g. Generate an image of a boat. This will make the agent use the tool text2image to generate an image.") |
|
|
|
|
|
with tabs[1]: |
|
|
|
agent_config.configure() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app_chat(agent_config) |