Skip to main content

llama-index llms huggingface api integration

Project description

LlamaIndex Llms Integration: Huggingface API

Integration with Hugging Face's Inference API for generating text.

For more information on Hugging Face's Inference API, visit Hugging Face's Inference API documentation.

Installation

pip install llama-index-llms-huggingface-api

Usage

from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI

llm = HuggingFaceInferenceAPI(
    model_name="openai-community/gpt2",
    temperature=0.7,
    max_tokens=100,
    token="<your-token>",  # Optional
)

response = llm.complete("Hello, how are you?")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_huggingface_api-0.4.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_llms_huggingface_api-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.4.1.tar.gz
Algorithm Hash digest
SHA256 935a115e579c25eaeb6685c5ced9457518271c9053892a7552643f725c15c2be
MD5 26e9e984838a514226420944a3085684
BLAKE2b-256 eb0de5514d64b276154f8742fc3e2f37b0117ba0fddfde9301a102902406f620

See more details on using hashes here.

File details

Details for the file llama_index_llms_huggingface_api-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1529b9e88997e712f6c651bde3823a8281cde269c4e565b0d438ad35627ad995
MD5 cd7e2cade5a6282d6294139612a744c2
BLAKE2b-256 9fb7395666cbc3ba32060f6b3ea3e27d4585550e2ed17ad22c78f22dfdbff4e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page