File size: 1,877 Bytes
fdfb0c4
cca6750
 
1c5a6c6
 
 
 
 
 
b658652
97ccb9a
365d369
 
 
1c13312
 
 
 
365d369
 
934d9a2
51f2e50
 
 
17e8776
ba5096c
23104a2
593ce6e
 
 
7118235
593ce6e
d2826a9
 
 
 
 
 
f3a9da9
593ce6e
7aabd0d
f3a9da9
 
2a2c3ec
8f2a15c
d9fa708
 
f3a9da9
8f2a15c
3f91442
235f64d
944514e
7aabd0d
f3a9da9
7aabd0d
 
235f64d
 
 
7aabd0d
235f64d
 
2a2c3ec
7aabd0d
 
f3a9da9
365d369
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import streamlit as st

from PIL import Image
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
import numpy as np
import re,sys,unicodedata

from app_agent_config import AgentConfig 

st.set_page_config(
    page_title="Custom Transformers can realy do anything...",
    page_icon="πŸ‘‹",
)
# Create an instance of AgentConfig
agent_config = AgentConfig()

#####
def on_close():
    print("The modal was closed!")

def open_modal():
    st.modal("User Guide", "Hello world")
# Define a callback function that will be called when the button is clicked
#def open_modal():
#    st.modal("User Guide", app_user_desc())

# Create a button that opens the modal

#######

import pandas as pd
from io import StringIO
with st.sidebar:

    st.button("User Description", open_modal)

    st.header("Set Tools and Option. ")

    with st.expander("Configure the agent and activate tools"):

            agent_config.configure()

    with st.expander("Set Content and Context"):

            agent_config.content_and_context()
         
# Create a page with tabs
#tabs = st.tabs(["Chat","User Description"])

#with tabs[0]: 
st.title("Hugging Face Agent and Tools")

## LB https://huggingface.co/spaces/qiantong-xu/toolbench-leaderboard

st.markdown("Welcome to the Hugging Face Agent and Tools app! This app allows you to interact with various tools using the Hugging Face Inference API.  CustomTransformers can do anything \nπŸ€ͺπŸ€—πŸ˜„πŸ€—πŸ€ͺ.")

    #st.markdown("Start to chat. e.g. Generate an image of a boat. This will make the agent use the tool text2image to generate an image. Set content, context, Inference URL , tools and logging in the sidebar.")
 
#with tabs[1]:
   # app_user_desc()
       
app_chat(agent_config)