Spaces:
Runtime error
Runtime error
File size: 466 Bytes
89e49dc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from fastapi import FastAPI
from transformers import pipeline
app= FastAPI()
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="nvidia/Llama-3_3-Nemotron-Super-49B-v1_5", trust_remote_code=True)
@app.get("/")
def home():
return {"Message":"Hello World"}
@app.get("./generate")
def generate(text:str):
output=pipe(text)
return{"output":output[0]['generated_text']} |