LukeMattingly commited on
Commit
d279586
·
1 Parent(s): 3ac40d9

fix hugging face token issue in the hub

Browse files
Files changed (2) hide show
  1. README.md +3 -3
  2. app.py +5 -4
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  title: Github PR Assistant
3
- emoji:
4
- colorFrom: pink
5
  colorTo: yellow
6
  sdk: gradio
7
  sdk_version: 5.15.0
@@ -15,5 +15,5 @@ tags:
15
  - agent-course
16
  ---
17
 
18
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
19
 
 
1
  ---
2
  title: Github PR Assistant
3
+ emoji: 🤖
4
+ colorFrom: red
5
  colorTo: yellow
6
  sdk: gradio
7
  sdk_version: 5.15.0
 
15
  - agent-course
16
  ---
17
 
18
+ # Github PR Reviewer
19
 
app.py CHANGED
@@ -388,9 +388,10 @@ final_answer = FinalAnswerTool()
388
  # 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:
389
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
390
 
391
- hf_token = os.getenv("HF_TOKEN")
392
- if hf_token:
393
- login(token=hf_token)
 
394
 
395
  model = HfApiModel(
396
  max_tokens=2096,
@@ -405,7 +406,7 @@ with open("prompts.yaml", 'r') as stream:
405
 
406
  agent = CodeAgent(
407
  model=model,
408
- tools=[final_answer, get_open_pull_requests, find_todo_comments, get_pr_diff, get_pr_files_changed, detect_code_smells_diff, security_check_code, check_documentation_updates, lint_code, get_pr_diff_for_file ], ## add your tools here (don't remove final answer)
409
  max_steps=6,
410
  verbosity_level=1,
411
  grammar=None,
 
388
  # 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:
389
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
390
 
391
+ #local dev only?
392
+ #hf_token = os.getenv("HF_TOKEN")
393
+ #if hf_token:
394
+ # login(token=hf_token)
395
 
396
  model = HfApiModel(
397
  max_tokens=2096,
 
406
 
407
  agent = CodeAgent(
408
  model=model,
409
+ tools=[final_answer, get_open_pull_requests, find_todo_comments, get_pr_diff, get_pr_files_changed, detect_code_smells_diff, security_check_code_diff, check_documentation_updates, lint_code, get_pr_diff_for_file ], ## add your tools here (don't remove final answer)
410
  max_steps=6,
411
  verbosity_level=1,
412
  grammar=None,