query2plot / mycoder /src /inner /main.py
russkiyximik
Changed path logic for HF robustness
1765a9a
Raw History Blame Contribute Delete
540 Bytes
#!/usr/bin/env python
import warnings
from .crew import Coder
from .paths import OUTPUT_DIR
warnings.filterwarnings("ignore", category=SyntaxWarning, module="pysbd")
# Create output directory if it doesn't exist
OUTPUT_DIR.mkdir(exist_ok=True)
# Try to see if HF Space secret can be used
import dotenv
dotenv.load_dotenv()
def run(query: str):
"""
Run the crew.
"""
inputs = {
'assignment': query,
}
result = Coder().crew().kickoff(inputs=inputs)
print(result.raw)
return result