Untitled

mail@pastecode.io avatar
unknown
python
12 days ago
447 B
2
Indexable
Never
from llama_index.llms.huggingface import HuggingFaceLLM
from llama_index.embeddings.huggingface import HuggingFaceEmbedding

llm = HuggingFaceLLM(
    model_name=MODEL_NAME,
    tokenizer_name=MODEL_NAME,
    context_window=CONTEXT_WINDOW,
    generate_kwargs={"temperature": TEMPERATURE},
    device_map="auto",
)   
embedding = HuggingFaceEmbedding(
    model_name=EMBEDDING_NAME,
    device="cuda:2",
    trust_remote_code=True,
)
Leave a Comment