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