Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,22 +7,17 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
|
| 11 |
-
"TheBloke/Mistral-7B-Instruct-v0.1-
|
| 12 |
-
|
|
|
|
| 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 |
-
|
| 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
|