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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 37c866071e2ebd668e4714ccaf69811c7be3891e07546a513b0aaf78259112fb
MD5 7ece13b8374072ef0fd499f4d8dcfad9
BLAKE2b-256 126a5b6d40f1481496444b59228f5c9426601802b7f9826512f0bb0ee48adc44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed12bcf6986becee1dc5f7644ff22aa96070de3b463add22c3b6ceabc2bd2f43
MD5 31c4d507a07b8b6dd2735ab59c9a4329
BLAKE2b-256 13e25cdc0134c26834e26e9769c21cfa75d3041dd8041deea01817768656df63

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