WingNeville commited on
Commit
2b6cd68
·
verified ·
1 Parent(s): 9b46b99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,14 +1,17 @@
1
  import os
2
  from smolagents import GradioUI, CodeAgent, InferenceClientModel
 
3
 
4
  # Load the API key
5
  api_key = os.getenv('WingTokenAll')
6
 
7
- # Initialize the model with the API key
 
 
 
8
  model = InferenceClientModel(
9
  model='Qwen/Qwen2.5-Coder-32B-Instruct',
10
  model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
11
- use_auth_token=api_key # Pass the API key here
12
  )
13
 
14
  # Initialize the CodeAgent
 
1
  import os
2
  from smolagents import GradioUI, CodeAgent, InferenceClientModel
3
+ from huggingface_hub import login
4
 
5
  # Load the API key
6
  api_key = os.getenv('WingTokenAll')
7
 
8
+ # Log in using the API key
9
+ login(api_key)
10
+
11
+ # Initialize the model without the use_auth_token argument
12
  model = InferenceClientModel(
13
  model='Qwen/Qwen2.5-Coder-32B-Instruct',
14
  model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
 
15
  )
16
 
17
  # Initialize the CodeAgent