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.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f40b49c06c26837178cabd4099f82c8d8768edabfd93489118314016e98509a2
MD5 446ad9cc30f5a199d544e11fa3f73142
BLAKE2b-256 fdd3bf31263e9e1ca958b847c0de8f1f97228eac9997d09b0d687f4f3ae018dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f5ac3942026da31a413a512fe7f739e7babb4b398e6039012b8fa25249db3c
MD5 608cc8258831f96e78dd09b79e7a07de
BLAKE2b-256 14527b1f3b23d51d109746556d7644ffc43c0b38fbd13b95ecf6789b8ffabbfa

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