Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,8 @@ def play_audio(audio):
|
|
15 |
|
16 |
|
17 |
# From transformers import BertModel, BertTokenizer
|
18 |
-
from transformers import
|
|
|
19 |
|
20 |
import torch
|
21 |
from transformers import AutoModelForCausalLM, AutoTokenizer, Agent, LocalAgent
|
@@ -32,9 +33,25 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, Agent, LocalAgent
|
|
32 |
# Load tools
|
33 |
random_character_tool = load_tool("Chris4K/random-character-tool")
|
34 |
text_generation_tool = load_tool("Chris4K/text-generation-tool")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
|
37 |
-
tools = [random_character_tool, text_generation_tool]
|
38 |
|
39 |
# Define the custom HfAgent class
|
40 |
class CustomHfAgent(Agent):
|
|
|
15 |
|
16 |
|
17 |
# From transformers import BertModel, BertTokenizer
|
18 |
+
from transformers import load_tool
|
19 |
+
#from transformers import HfAgent, load_tool
|
20 |
|
21 |
import torch
|
22 |
from transformers import AutoModelForCausalLM, AutoTokenizer, Agent, LocalAgent
|
|
|
33 |
# Load tools
|
34 |
random_character_tool = load_tool("Chris4K/random-character-tool")
|
35 |
text_generation_tool = load_tool("Chris4K/text-generation-tool")
|
36 |
+
sentiment_tool = load_tool("Chris4K/sentiment-tool")
|
37 |
+
token_counter_tool = load_tool("Chris4K/token-counter-tool")
|
38 |
+
most_downloaded_model = load_tool("Chris4K/most-downloaded-model")
|
39 |
+
rag_tool = load_tool("Chris4K/rag-tool")
|
40 |
+
word_counter_tool = load_tool("Chris4K/word-counter-tool")
|
41 |
+
sentence_counter_tool = load_tool("Chris4K/sentence-counter-tool")
|
42 |
+
emojify_text_tool = load_tool("Chris4K/Chris4K/EmojifyTextTool")
|
43 |
+
namedEntityRecognitionTool = load_tool("Chris4K/NamedEntityRecognitionTool")
|
44 |
+
textDownloadTool = load_tool("Chris4K/TextDownloadTool")
|
45 |
+
sourcecode_retriever_tool = load_tool("Chris4K/source-code-retriever-tool")
|
46 |
+
|
47 |
+
text_to_image = load_tool("Chris4K/text-to-image")
|
48 |
+
text_to_video = load_tool("Chris4K/text-to-video")
|
49 |
+
image_transformation = load_tool("Chris4K/image-transformation")
|
50 |
+
latent_upscaler_tool = load_tool("Chris4K/latent-upscaler-tool")
|
51 |
+
|
52 |
+
tools = [random_character_tool, text_generation_tool, sentiment_tool, token_counter_tool, most_downloaded_model, word_counter_tool, sentence_counter_tool, emojify_text_tool , namedEntityRecognitionTool, sourcecode_retriever_tool, text_to_image, text_to_video, image_transformation, latent_upscaler_tool ]
|
53 |
|
54 |
|
|
|
55 |
|
56 |
# Define the custom HfAgent class
|
57 |
class CustomHfAgent(Agent):
|