Merge pull request #375 from DinkoTontchev/patch-1
Update llama-hub.mdx
This commit is contained in:
@@ -30,15 +30,24 @@ Underneath, we can see an example of the usage of **the Hugging Face inference A
|
||||
|
||||
```python
|
||||
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load the .env file
|
||||
load_dotenv()
|
||||
|
||||
# Retrieve HF_TOKEN from the environment variables
|
||||
hf_token = os.getenv("HF_TOKEN")
|
||||
|
||||
llm = HuggingFaceInferenceAPI(
|
||||
model_name="Qwen/Qwen2.5-Coder-32B-Instruct",
|
||||
temperature=0.7,
|
||||
max_tokens=100,
|
||||
token="hf_xxx",
|
||||
token=hf_token,
|
||||
)
|
||||
|
||||
llm.complete("Hello, how are you?")
|
||||
response = llm.complete("Hello, how are you?")
|
||||
print(response)
|
||||
# I am good, how can I help you today?
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user