Spaces:
Runtime error
Runtime error
Deploy GAIA agent
Browse files- .config +60 -0
- requirements.txt +8 -31
.config
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Configuration file for GAIA Agent
|
2 |
+
|
3 |
+
# Model Configuration
|
4 |
+
MODEL_CONFIG = {
|
5 |
+
"model_id": "microsoft/DialoGPT-medium", # Lightweight model for resource constraints
|
6 |
+
"max_tokens": 512, # Reduced for memory efficiency
|
7 |
+
"temperature": 0.1, # Low temperature for factual responses
|
8 |
+
"fallback_model": "gpt-3.5-turbo", # Fallback if primary model fails
|
9 |
+
}
|
10 |
+
|
11 |
+
# Agent Configuration
|
12 |
+
AGENT_CONFIG = {
|
13 |
+
"max_iterations": 5, # Limit iterations to prevent infinite loops
|
14 |
+
"verbosity_level": 1, # Moderate verbosity for debugging
|
15 |
+
"timeout_seconds": 30, # Timeout for individual operations
|
16 |
+
"max_retries": 2, # Number of retries for failed operations
|
17 |
+
}
|
18 |
+
|
19 |
+
# Tool Configuration
|
20 |
+
TOOL_CONFIG = {
|
21 |
+
"web_search": {
|
22 |
+
"enabled": True,
|
23 |
+
"max_results": 5, # Limit search results for efficiency
|
24 |
+
"timeout": 10,
|
25 |
+
},
|
26 |
+
"calculator": {
|
27 |
+
"enabled": True,
|
28 |
+
"safe_mode": True, # Only allow safe mathematical expressions
|
29 |
+
},
|
30 |
+
"image_analyzer": {
|
31 |
+
"enabled": True,
|
32 |
+
"max_image_size": 5 * 1024 * 1024, # 5MB limit
|
33 |
+
"supported_formats": [".jpg", ".jpeg", ".png", ".gif", ".bmp"],
|
34 |
+
},
|
35 |
+
"file_reader": {
|
36 |
+
"enabled": True,
|
37 |
+
"max_file_size": 10 * 1024 * 1024, # 10MB limit
|
38 |
+
"supported_formats": [".txt", ".csv", ".json", ".md", ".py", ".js", ".html", ".css"],
|
39 |
+
},
|
40 |
+
"data_processor": {
|
41 |
+
"enabled": True,
|
42 |
+
"max_data_points": 10000, # Limit for large datasets
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
# Performance Configuration
|
47 |
+
PERFORMANCE_CONFIG = {
|
48 |
+
"memory_limit_mb": 2048, # 2GB memory limit per process
|
49 |
+
"cpu_limit_percent": 80, # Maximum CPU usage
|
50 |
+
"garbage_collection_frequency": 10, # Run GC every N operations
|
51 |
+
"cache_size": 100, # Number of cached responses
|
52 |
+
}
|
53 |
+
|
54 |
+
# API Configuration
|
55 |
+
API_CONFIG = {
|
56 |
+
"default_api_url": "https://agents-course-unit4-scoring.hf.space",
|
57 |
+
"request_timeout": 60,
|
58 |
+
"max_concurrent_requests": 2, # Limit concurrent requests
|
59 |
+
}
|
60 |
+
|
requirements.txt
CHANGED
@@ -1,33 +1,10 @@
|
|
1 |
-
|
2 |
-
gradio==4.44.0
|
3 |
requests==2.31.0
|
4 |
pandas==2.0.3
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
# Plotting (lightweight alternative to matplotlib)
|
14 |
-
matplotlib==3.7.2
|
15 |
-
|
16 |
-
# JSON and data processing
|
17 |
-
pathlib
|
18 |
-
|
19 |
-
# Web search
|
20 |
-
duckduckgo-search==3.9.6
|
21 |
-
|
22 |
-
# LLM integration (lightweight)
|
23 |
-
litellm==1.44.14
|
24 |
-
|
25 |
-
# Optional: For better performance with limited resources
|
26 |
-
psutil==5.9.5
|
27 |
-
|
28 |
-
# File processing utilities
|
29 |
-
openpyxl==3.1.2 # For Excel files if needed
|
30 |
-
python-magic==0.4.27 # For file type detection
|
31 |
-
|
32 |
-
# Math and scientific computing (minimal)
|
33 |
-
sympy==1.12 # For symbolic math if needed
|
|
|
1 |
+
gradio==4.19.1
|
|
|
2 |
requests==2.31.0
|
3 |
pandas==2.0.3
|
4 |
+
smol_agent==0.1.2
|
5 |
+
transformers==4.38.2
|
6 |
+
accelerate==0.27.2
|
7 |
+
bitsandbytes==0.42.0
|
8 |
+
tavily-python==0.3.1
|
9 |
+
python-dotenv==1.0.1
|
10 |
+
torch==2.2.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|