luanpoppe
initial commit
6590dbb
raw
history blame
489 Bytes
from fastapi import FastAPI
import os
app = FastAPI()
@app.get("/")
def greet_json():
return {"Hello": "World!"}
@app.get("/hello")
def hello():
llm = HuggingFaceEndpoint(
repo_id="meta-llama/Meta-Llama-3-8B-Instruct",
task="text-generation",
max_new_tokens=100,
do_sample=False,
huggingfacehub_api_token = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
)
result = llm.invoke("Hugging Face is")
print('result: ', result)
return (result)