Buddi / main.py
CaptMetal's picture
Update main.py
35740c0 verified
raw
history blame contribute delete
433 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
from transformers import pipeline
app = FastAPI()
chatbot = pipeline("conversational", model="CaptMetal/BuddAi")
class Message(BaseModel):
text: str
@app.post("/chat")
async def chat(message: Message):
response = chatbot(message.text)
return {"response": response}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)