Spaces:
Building
Building
from fastapi import FastAPI | |
import subprocess # Import subprocess module to run system commands | |
import ollama | |
app = FastAPI() | |
def read_root(): | |
return {"message": "Welcome to the Quantum-API/codelama"} | |
# Add other endpoints as needed for interacting with ollama | |
def run_codelama(): | |
# You can call ollama commands here or use subprocess | |
result = subprocess.run(["ollama", "run", "codellama:latest"], capture_output=True, text=True) | |
return {"result": result.stdout} | |