File size: 326 Bytes
29a9262 e238a57 29a9262 e238a57 29a9262 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import os
from langchain_community.llms import HuggingFaceEndpoint
_api = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
def get_response(prompt: str):
llm = HuggingFaceEndpoint(
repo_id="CineAI/FreeThinker3B",
max_length=1024,
temperature=0.5,
token=_api,
)
return llm.invoke(prompt) |