21spl commited on
Commit
8f16b96
·
verified ·
1 Parent(s): 128c031

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -11,6 +11,7 @@ from Gradio_UI import GradioUI
11
 
12
  # Load the API key from Hugging Face Spaces secrets (environment variable)
13
  API_KEY = os.getenv("CRICKETDATA_API_KEY", "default_key_if_not_found")
 
14
  BASE_URL = "https://api.cricketdata.org/v1"
15
 
16
  # Custom Tool: Analyze Cricketer Form
@@ -175,10 +176,10 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
175
 
176
  # Model setup
177
  model = HfApiModel(
178
- max_tokens=2096,
179
- temperature=0.5,
180
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
181
- custom_role_conversions=None,
182
  )
183
 
184
  # Load prompt templates
@@ -197,4 +198,10 @@ agent = CodeAgent(
197
 
198
  # Launch the Gradio UI
199
  if __name__ == "__main__":
200
- GradioUI(agent).launch()
 
 
 
 
 
 
 
11
 
12
  # Load the API key from Hugging Face Spaces secrets (environment variable)
13
  API_KEY = os.getenv("CRICKETDATA_API_KEY", "default_key_if_not_found")
14
+ HF_TOKEN = os.getenv("HF_TOKEN", "default_hf_token_if_not_found")
15
  BASE_URL = "https://api.cricketdata.org/v1"
16
 
17
  # Custom Tool: Analyze Cricketer Form
 
176
 
177
  # Model setup
178
  model = HfApiModel(
179
+ max_tokens=2096,
180
+ temperature=0.5,
181
+ model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
182
+ custom_role_conversions=None,
183
  )
184
 
185
  # Load prompt templates
 
198
 
199
  # Launch the Gradio UI
200
  if __name__ == "__main__":
201
+ GradioUI(agent).launch()
202
+
203
+
204
+
205
+ # 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:
206
+ # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
207
+