zerito commited on
Commit
ce371a4
·
verified ·
1 Parent(s): e5064d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from huggingface_hub import login
2
  from smolagents import (
3
  CodeAgent,
4
  ToolCallingAgent,
@@ -12,8 +12,12 @@ from markdownify import markdownify
12
  from requests.exceptions import RequestException
13
  from transformers import pipeline
14
 
15
- # Login to Hugging Face Hub
16
- login()
 
 
 
 
17
 
18
  # Define the model ID
19
  model_id = "Qwen/Qwen2.5-Coder-32B-Instruct"
@@ -138,4 +142,9 @@ btc_agent = CodeAgent(
138
 
139
  # Launch the Gradio interface
140
  from Gradio_UI import GradioUI
141
- GradioUI(btc_agent).launch()
 
 
 
 
 
 
1
+ import os
2
  from smolagents import (
3
  CodeAgent,
4
  ToolCallingAgent,
 
12
  from requests.exceptions import RequestException
13
  from transformers import pipeline
14
 
15
+ # Set the Hugging Face token using an environment variable
16
+ # Make sure to set the HUGGING_FACE_HUB_TOKEN environment variable in your environment
17
+ # Example: os.environ['HUGGING_FACE_HUB_TOKEN'] = 'your_hugging_face_token'
18
+
19
+ # Alternatively, you can set it directly in the code for testing purposes
20
+ # os.environ['HUGGING_FACE_HUB_TOKEN'] = 'your_hugging_face_token'
21
 
22
  # Define the model ID
23
  model_id = "Qwen/Qwen2.5-Coder-32B-Instruct"
 
142
 
143
  # Launch the Gradio interface
144
  from Gradio_UI import GradioUI
145
+
146
+ def gradio_interface(prompt):
147
+ result = btc_agent.run(prompt)
148
+ return result
149
+
150
+ GradioUI(gradio_interface).launch()