from fastapi import FastAPI | |
import os | |
app = FastAPI() | |
def greet_json(): | |
return {"Hello": "World!"} | |
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) |