unknown commited on
Commit
65719ee
·
1 Parent(s): ba949f7

Fix: Remove @gr .mcp.tool() decorators and add numpy<2.0.0 for HuggingFace compatibility

Browse files
Files changed (2) hide show
  1. app.py +0 -6
  2. requirements.txt +1 -0
app.py CHANGED
@@ -37,7 +37,6 @@ except Exception as e:
37
  # CORE MCP TOOLS
38
  # ===========================
39
 
40
- @gr.mcp.tool()
41
  def analyze_screenshot(image: Image.Image, requirements: str) -> Dict:
42
  """Analyze AWS console screenshot and extract ETL pipeline requirements."""
43
  try:
@@ -70,7 +69,6 @@ Return JSON with: sources, transformations, targets, estimated_volume, frequency
70
  return {"error": f"Screenshot analysis failed: {str(e)}"}
71
 
72
 
73
- @gr.mcp.tool()
74
  def generate_glue_script(requirements: Dict, optimization_level: str = "balanced") -> Dict:
75
  """Generate optimized AWS Glue PySpark ETL script."""
76
  try:
@@ -91,7 +89,6 @@ Include error handling, logging, and AWS Glue best practices."""}]
91
  return {"error": f"Script generation failed: {str(e)}"}
92
 
93
 
94
- @gr.mcp.tool()
95
  def simulate_glue_cost(requirements: Dict, worker_type: str = "G.1X", num_workers: int = 2) -> Dict:
96
  """Simulate AWS Glue job cost."""
97
  try:
@@ -134,7 +131,6 @@ def simulate_glue_cost(requirements: Dict, worker_type: str = "G.1X", num_worker
134
  return {"error": f"Cost simulation failed: {str(e)}"}
135
 
136
 
137
- @gr.mcp.tool()
138
  def generate_cdk_infrastructure(requirements: Dict, script: str) -> Dict:
139
  """Generate AWS CDK Python code."""
140
  try:
@@ -154,7 +150,6 @@ Include Glue job, IAM, S3, CloudWatch, EventBridge."""}]
154
  return {"error": f"CDK generation failed: {str(e)}"}
155
 
156
 
157
- @gr.mcp.tool()
158
  def generate_voice_explanation(content: str) -> str:
159
  """Generate voice narration using ElevenLabs TTS."""
160
  try:
@@ -177,7 +172,6 @@ def generate_voice_explanation(content: str) -> str:
177
  return f"Voice generation failed: {str(e)}"
178
 
179
 
180
- @gr.mcp.tool()
181
  def find_similar_pipelines(query: str, top_k: int = 3) -> Dict:
182
  """Find similar ETL pipeline templates using RAG."""
183
  try:
 
37
  # CORE MCP TOOLS
38
  # ===========================
39
 
 
40
  def analyze_screenshot(image: Image.Image, requirements: str) -> Dict:
41
  """Analyze AWS console screenshot and extract ETL pipeline requirements."""
42
  try:
 
69
  return {"error": f"Screenshot analysis failed: {str(e)}"}
70
 
71
 
 
72
  def generate_glue_script(requirements: Dict, optimization_level: str = "balanced") -> Dict:
73
  """Generate optimized AWS Glue PySpark ETL script."""
74
  try:
 
89
  return {"error": f"Script generation failed: {str(e)}"}
90
 
91
 
 
92
  def simulate_glue_cost(requirements: Dict, worker_type: str = "G.1X", num_workers: int = 2) -> Dict:
93
  """Simulate AWS Glue job cost."""
94
  try:
 
131
  return {"error": f"Cost simulation failed: {str(e)}"}
132
 
133
 
 
134
  def generate_cdk_infrastructure(requirements: Dict, script: str) -> Dict:
135
  """Generate AWS CDK Python code."""
136
  try:
 
150
  return {"error": f"CDK generation failed: {str(e)}"}
151
 
152
 
 
153
  def generate_voice_explanation(content: str) -> str:
154
  """Generate voice narration using ElevenLabs TTS."""
155
  try:
 
172
  return f"Voice generation failed: {str(e)}"
173
 
174
 
 
175
  def find_similar_pipelines(query: str, top_k: int = 3) -> Dict:
176
  """Find similar ETL pipeline templates using RAG."""
177
  try:
requirements.txt CHANGED
@@ -13,6 +13,7 @@ modal>=1.2.0
13
  chromadb>=0.4.18
14
  sentence-transformers>=2.2.0
15
  pyarrow==14.0.1
 
16
 
17
  # AWS & Cloud
18
  boto3>=1.34.0
 
13
  chromadb>=0.4.18
14
  sentence-transformers>=2.2.0
15
  pyarrow==14.0.1
16
+ numpy<2.0.0
17
 
18
  # AWS & Cloud
19
  boto3>=1.34.0