AlexDGenu commited on
Commit
9d3daac
·
1 Parent(s): c195ce7

Remove dotenv dependency and update error message for Hugging Face token in SmolAgent initialization.

Browse files
Files changed (2) hide show
  1. app.py +1 -4
  2. requirements.txt +0 -1
app.py CHANGED
@@ -3,11 +3,8 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
6
- from dotenv import load_dotenv
7
  from smolagents import CodeAgent, InferenceClientModel
8
 
9
- load_dotenv()
10
-
11
  # (Keep Constants as is)
12
  # --- Constants ---
13
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
@@ -19,7 +16,7 @@ class SmolAgent:
19
  def __init__(self, hf_token: str):
20
  print("Initializing SmolAgent...")
21
  if not hf_token:
22
- raise ValueError("Hugging Face token not found. Please set HF_TOKEN environment variable.")
23
 
24
  # 3. Initialize the SmolLM model
25
  model = InferenceClientModel(
 
3
  import requests
4
  import inspect
5
  import pandas as pd
 
6
  from smolagents import CodeAgent, InferenceClientModel
7
 
 
 
8
  # (Keep Constants as is)
9
  # --- Constants ---
10
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
16
  def __init__(self, hf_token: str):
17
  print("Initializing SmolAgent...")
18
  if not hf_token:
19
+ raise ValueError("Hugging Face token not found. Please set HF_TOKEN environment variable in HF Spaces settings.")
20
 
21
  # 3. Initialize the SmolLM model
22
  model = InferenceClientModel(
requirements.txt CHANGED
@@ -1,6 +1,5 @@
1
  smolagents
2
  huggingface_hub
3
- python-dotenv
4
  gradio
5
  requests
6
  pandas
 
1
  smolagents
2
  huggingface_hub
 
3
  gradio
4
  requests
5
  pandas