jerry1979 commited on
Commit
fa3f74a
·
verified ·
1 Parent(s): 2961917

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -3,11 +3,23 @@ import datetime
3
  import requests
4
  import pytz
5
  import yaml
 
6
  from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
 
 
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
 
 
 
 
 
 
 
 
11
  @tool
12
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
13
  #Keep this format for the description / args / args description but feel free to modify the tool
 
3
  import requests
4
  import pytz
5
  import yaml
6
+ import load_tool , tool
7
  from tools.final_answer import FinalAnswerTool
8
 
9
  from Gradio_UI import GradioUI
10
 
11
+ textgen = load_tool("text-heneration" ,
12
+ model="mistralai/Mistral-7B-Instruct-v0.2")
13
+
14
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
15
+
16
+ @tool
17
+ def ask_questions(question: str)-> str:
18
+ """
19
+ Ask any general question and get and AI-generated answer.
20
+ """
21
+ return textgen(question)
22
+
23
  @tool
24
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
25
  #Keep this format for the description / args / args description but feel free to modify the tool