Spaces:
Runtime error
Runtime error
File size: 492 Bytes
5553e22 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import os
from langchain_community.llms import HuggingFaceEndpoint
def load_llm(repo_id="mistralai/Mistral-7B-Instruct-v0.2"):
'''
Load the LLM from the HuggingFace model hub
Args:
repo_id (str): The HuggingFace model ID
Returns:
llm (HuggingFaceEndpoint): The LLM model
'''
repo_id = repo_id
llm = HuggingFaceEndpoint(
repo_id=repo_id, max_length=128, temperature=0.2, token=token)
return llm
def guardrails():
return None
|