from fastapi import FastAPI from transformers import pipeline # Use the text-generation pipeline pipe = pipeline("text-generation", model="Hawoly18/Adia_Llama3.1") app = FastAPI() @app.get('/') def home(): return {"hello": "Concree"} @app.get('/generate') def generate(text: str): # Generate text using the pipeline result = pipe(text) return {"result": result[0]['generated_text']}