InnaV commited on
Commit
cbf9978
·
verified ·
1 Parent(s): 8cdb946

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -7,6 +7,19 @@ from Gradio_UI import GradioUI
7
  # Load BERTopic model
8
  topic_model = BERTopic.load("MaartenGr/BERTopic_ArXiv")
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  @tool
11
  def extract_main_topic(arg1: str) -> str:
12
  """
@@ -41,6 +54,9 @@ model = HfApiModel(
41
  custom_role_conversions=None,
42
  )
43
 
 
 
 
44
  with open("prompts.yaml", 'r') as stream:
45
  prompt_templates = yaml.safe_load(stream)
46
 
 
7
  # Load BERTopic model
8
  topic_model = BERTopic.load("MaartenGr/BERTopic_ArXiv")
9
 
10
+ @tool
11
+ def my_custom_tool(arg1: str) -> str:
12
+ """
13
+ Processes input text and returns a modified version.
14
+
15
+ Args:
16
+ arg1 (str): The input text to process.
17
+
18
+ Returns:
19
+ str: The processed text output.
20
+ """
21
+ return f"Processed text: {arg1}"
22
+
23
  @tool
24
  def extract_main_topic(arg1: str) -> str:
25
  """
 
54
  custom_role_conversions=None,
55
  )
56
 
57
+ # Import tool from Hugging Face
58
+ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
59
+
60
  with open("prompts.yaml", 'r') as stream:
61
  prompt_templates = yaml.safe_load(stream)
62