Chris4K commited on
Commit
b65d54b
·
verified ·
1 Parent(s): 20af5e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -67
app.py CHANGED
@@ -14,6 +14,7 @@ import numpy as np
14
  from custom_agent import CustomHfAgent
15
  from tool_loader import ToolLoader
16
  from tool_config import tool_names
 
17
 
18
 
19
  # For Altair charts
@@ -116,74 +117,9 @@ with tabs[1]:
116
 
117
  # Tab 3: User Description
118
  with tabs[2]:
119
-
120
- # User description content and tool descriptions
121
- # Add a section for the app's description
122
- st.markdown('''
123
- # Hugging Face Agent and Tools App
124
-
125
- ## Description
126
- Welcome to the Hugging Face Agent and Tools app! This app provides an interactive interface for utilizing various tools through the Hugging Face API. You can choose an inference URL and select from a variety of tools to perform different tasks.
127
-
128
- ## Examples
129
- 1. **Generate a Random Character**:
130
- - Choose the desired URL and the 'Random Character Tool'.
131
- - Then type 'Genarate random Character'
132
-
133
- 2. **Sentiment Analysis**:
134
- - Choose the desired URL and the 'Sentiment Analysis Tool'.
135
- - Sample: What is the sentiment for "Hello, I am happy"?
136
-
137
- 3. **Word Count**:
138
- - Choose the desired URL and the 'Word Counter Tool'.
139
- - Sample: Count the words in "Hello, I am Christof".
140
-
141
- Other samples:
142
-
143
- - Generate a random character.
144
- - What is the sentiment for "Hello I am happy"
145
- - Count the words of "Hello I am Christof”
146
- - What is the most downloaded model for text2image
147
- - Use ner_tool to find the information in the following text:"Hello I am Christof.".
148
- - Download the text from https://docs.streamlit.io/get-started/installation
149
- - Scrape source code from https://docs.streamlit.io/get-started/installation
150
- - label for text="Hello I am Christof" classifies greeting
151
-
152
-
153
- ## Tools
154
- To interact with the tools, expand the section below to see tool descriptions and select the tools you want to use.
155
-
156
- Expand to see tool descriptions
157
-
158
- ### Tool Descriptions
159
- - **random-character-tool:** Generates a random character.
160
- - **text-generation-tool:** Generates text based on a prompt.
161
- - **sentiment-tool:** Analyzes the sentiment of a given text.
162
- - **token-counter-tool:** Counts the tokens in a text.
163
- - **most-downloaded-model:** Provides information about the most downloaded model.
164
- - **rag-tool:** Utilizes Retrieval-Augmented Generation (RAG) for text generation.
165
- - **word-counter-tool:** Counts the words in a text.
166
- - **sentence-counter-tool:** Counts the sentences in a text.
167
- - **EmojifyTextTool:** Emojifies the given text.
168
- - **NamedEntityRecognitionTool:** Identifies named entities in a text.
169
- - **TextDownloadTool:** Downloads text from a given URL.
170
- - **source-code-retriever-tool:** Retrieves source code from a given URL.
171
- - **text-to-image:** Generates an image from text.
172
- - **text-to-video:** Generates a video from text.
173
- - **image-transformation:** Applies transformations to images.
174
- - **latent-upscaler-tool:** Upscales images using latent space.
175
-
176
-
177
- ## Usage
178
- 1. Choose the desired inference URL from the dropdown.
179
- 2. Expand the tool selection section and choose the tools you want to use.
180
- 3. Enter a message in the chat input to interact with the Hugging Face Agent.
181
- 4. View the assistant's responses, which may include images, audio, text, or other visualizations based on the selected tools.
182
-
183
- Feel free to explore and experiment with different tools to achieve various tasks!
184
-
185
- ''')
186
 
 
187
  # Tab 4: Developers
188
  with tabs[3]:
189
 
 
14
  from custom_agent import CustomHfAgent
15
  from tool_loader import ToolLoader
16
  from tool_config import tool_names
17
+ from app_description import show_app_description
18
 
19
 
20
  # For Altair charts
 
117
 
118
  # Tab 3: User Description
119
  with tabs[2]:
120
+ st.markdown(show_app_description())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
+
123
  # Tab 4: Developers
124
  with tabs[3]:
125