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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06f0debc4254d933d3f113017b45d9d6053569cb312869694bded4b59456956a
MD5 db55c92d5697d3e23203bd558b2e2b9e
BLAKE2b-256 0ca88ab98d754f211dc9d64aba0346f38caa7d247c1ba8b4f54c370ec532f32a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_llms_huggingface_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76d771922503c1d7cf765e9bde896be47ab3936f938750ce2e5643d8db5f41dd
MD5 b4203462f023debdcacb6a0d266f9c84
BLAKE2b-256 cf971db63177240317aad0704c8bec84284a039db6c498a60a910f4878906fee

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