Spaces:
Sleeping
Sleeping
Create app.py
Browse files1234567891011121314151617from fastapi import FastAPI, Requestfrom llama_cpp import Llama
app = FastAPI()# Load your 3.6GB modelllm = Llama(model_path="./mpt-7b-chat.ggmlv0.q4_0.bin")
@app.post("/v1/chat")async def chat(request: Request): data = await request.json() # Basic API logic: response = llm(data["prompt"], max_tokens=100) return {"choices": [{"text": response["choices"][0]["text"]}]}
@app.get("/")def home(): return {"status": "Your AI is Always Up!"}app.pyAdded+17