Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -37,14 +37,14 @@ def load_config() -> Dict:
|
|
37 |
'temperature': 0.5,
|
38 |
'verbose': True
|
39 |
}
|
40 |
-
|
41 |
try:
|
42 |
with open(config_path, 'r') as config_file:
|
43 |
config = yaml.safe_load(config_file)
|
44 |
except FileNotFoundError:
|
45 |
print(f"Config file not found at {config_path}. Using default configuration.")
|
46 |
config = default_config
|
47 |
-
|
48 |
# Override with environment variables if set
|
49 |
config['api_key'] = os.getenv('HUGGINGFACE_API_KEY', config['api_key'])
|
50 |
return config
|
@@ -151,7 +151,7 @@ class Agent:
|
|
151 |
self.role = role
|
152 |
self.tools = tools
|
153 |
self.memory: List[tuple] = []
|
154 |
-
|
155 |
try:
|
156 |
self.llm = HuggingFaceHub(
|
157 |
repo_id=config['model_name'],
|
|
|
37 |
'temperature': 0.5,
|
38 |
'verbose': True
|
39 |
}
|
40 |
+
|
41 |
try:
|
42 |
with open(config_path, 'r') as config_file:
|
43 |
config = yaml.safe_load(config_file)
|
44 |
except FileNotFoundError:
|
45 |
print(f"Config file not found at {config_path}. Using default configuration.")
|
46 |
config = default_config
|
47 |
+
|
48 |
# Override with environment variables if set
|
49 |
config['api_key'] = os.getenv('HUGGINGFACE_API_KEY', config['api_key'])
|
50 |
return config
|
|
|
151 |
self.role = role
|
152 |
self.tools = tools
|
153 |
self.memory: List[tuple] = []
|
154 |
+
|
155 |
try:
|
156 |
self.llm = HuggingFaceHub(
|
157 |
repo_id=config['model_name'],
|