Added token handling in app.py
#249
by
radubutucelea23 - opened
app.py
CHANGED
|
@@ -3,10 +3,14 @@ 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
|
|
@@ -44,6 +48,7 @@ max_tokens=2096,
|
|
| 44 |
temperature=0.5,
|
| 45 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 46 |
custom_role_conversions=None,
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
import os
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
| 11 |
+
# Load the token you have configured in the 'settings' of this space
|
| 12 |
+
token = os.environ.get("YOUR_TOKEN_NAME")
|
| 13 |
+
|
| 14 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 15 |
@tool
|
| 16 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
|
|
|
| 48 |
temperature=0.5,
|
| 49 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 50 |
custom_role_conversions=None,
|
| 51 |
+
token=token
|
| 52 |
)
|
| 53 |
|
| 54 |
|