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

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d0cabc8fd872aac71cb68586127d6cee3aea6ceaa0bc7ef6ef0e7ca4bf4cecfd
MD5 0b93379a063165bf7e30f7f3dc576df3
BLAKE2b-256 ab8c86e4704d65648368c222abac1968c25fe3bb3477da2fa6a8ecd4eb1d1fdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa835acc8132118f014559d96bb74944f0314fd0ac0363e87547a548b4b05aca
MD5 b27e481b68bb94c5545a319653cbb48c
BLAKE2b-256 6829487fe384abe3e81d47867fcb5a5e958b8ee68b6cbb10a303c32f087406f3

See more details on using hashes here.

Supported by

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