Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def summarize_text_tool(text:str)-> str:
|
|
45 |
text: the text to be summaried
|
46 |
"""
|
47 |
try:
|
48 |
-
hf_token = os.getenv('
|
49 |
client = InferenceClient(api_key=hf_token)
|
50 |
messages = [
|
51 |
{
|
@@ -71,7 +71,7 @@ def helper_text_tool(text:str)-> str:
|
|
71 |
text: the text to be analyzed
|
72 |
"""
|
73 |
try:
|
74 |
-
hf_token = os.getenv('
|
75 |
client = InferenceClient(api_key=hf_token)
|
76 |
messages = [
|
77 |
{
|
@@ -94,11 +94,13 @@ visit_webpage = VisitWebpageTool()
|
|
94 |
|
95 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
96 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
97 |
model = HfApiModel(
|
98 |
max_tokens=2096,
|
99 |
temperature=0.5,
|
100 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
101 |
custom_role_conversions=None,
|
|
|
102 |
)
|
103 |
|
104 |
# Import tool from Hub
|
|
|
45 |
text: the text to be summaried
|
46 |
"""
|
47 |
try:
|
48 |
+
hf_token = os.getenv('HF_TOKEN')
|
49 |
client = InferenceClient(api_key=hf_token)
|
50 |
messages = [
|
51 |
{
|
|
|
71 |
text: the text to be analyzed
|
72 |
"""
|
73 |
try:
|
74 |
+
hf_token = os.getenv('HF_TOKEN')
|
75 |
client = InferenceClient(api_key=hf_token)
|
76 |
messages = [
|
77 |
{
|
|
|
94 |
|
95 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
96 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
97 |
+
hf_token = os.getenv('HF_TOKEN')
|
98 |
model = HfApiModel(
|
99 |
max_tokens=2096,
|
100 |
temperature=0.5,
|
101 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
102 |
custom_role_conversions=None,
|
103 |
+
api_key=hf_token
|
104 |
)
|
105 |
|
106 |
# Import tool from Hub
|