from fastapi import FastAPI # Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-8B-Instruct") app = FastAPI() @app.get('/') def home(): return {"hello": "Geominds"} @app.get('/ask') def ask(prompt: str): result = pipe(prompt) return result[0]