jerry1979 commited on
Commit
e2d5de1
·
verified ·
1 Parent(s): 17fb548

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -7,22 +7,17 @@ from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
10
- textgen = load_tool(
11
- "TheBloke/Mistral-7B-Instruct-v0.1-GGU", # replace with a real Hugging Face repo
12
- trust_remote_code=True
 
13
  )
14
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
15
 
16
  @tool
17
  def ask_question(question: str) -> str:
18
- """
19
- Ask any general question and get an AI-generated answer.
20
-
21
- Args:
22
- question: The question you want to ask the AI
23
- """
24
- # Call the loaded textgen tool with the question
25
- return textgen(question)
26
 
27
  @tool
28
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
 
7
 
8
  from Gradio_UI import GradioUI
9
 
10
+ model = HfApiModel(
11
+ model_id="TheBloke/Mistral-7B-Instruct-v0.1-GGUF", # public model
12
+ max_tokens=1024,
13
+ temperature=0.7
14
  )
15
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
16
 
17
  @tool
18
  def ask_question(question: str) -> str:
19
+ """Ask a general question using Mistral"""
20
+ return model(question)
 
 
 
 
 
 
21
 
22
  @tool
23
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type