mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-15 14:08:00 +00:00
Fix NVIDIA NIM Doc
This commit is contained in:
parent
0caef40e0d
commit
c8d66bbf9b
1 changed files with 9 additions and 7 deletions
|
@ -42,8 +42,8 @@ client.initialize()
|
||||||
### Create Completion
|
### Create Completion
|
||||||
|
|
||||||
```python
|
```python
|
||||||
response = client.completion(
|
response = client.inference.completion(
|
||||||
model_id="meta-llama/Llama-3.1-8b-Instruct",
|
model_id="meta-llama/Llama-3.1-8B-Instruct",
|
||||||
content="Complete the sentence using one word: Roses are red, violets are :",
|
content="Complete the sentence using one word: Roses are red, violets are :",
|
||||||
stream=False,
|
stream=False,
|
||||||
sampling_params={
|
sampling_params={
|
||||||
|
@ -56,8 +56,8 @@ print(f"Response: {response.content}")
|
||||||
### Create Chat Completion
|
### Create Chat Completion
|
||||||
|
|
||||||
```python
|
```python
|
||||||
response = client.chat_completion(
|
response = client.inference.chat_completion(
|
||||||
model_id="meta-llama/Llama-3.1-8b-Instruct",
|
model_id="meta-llama/Llama-3.1-8B-Instruct",
|
||||||
messages=[
|
messages=[
|
||||||
{
|
{
|
||||||
"role": "system",
|
"role": "system",
|
||||||
|
@ -78,8 +78,10 @@ print(f"Response: {response.completion_message.content}")
|
||||||
|
|
||||||
### Create Embeddings
|
### Create Embeddings
|
||||||
```python
|
```python
|
||||||
response = client.embeddings(
|
response = client.inference.embeddings(
|
||||||
model_id="meta-llama/Llama-3.1-8b-Instruct", contents=["foo", "bar", "baz"]
|
model_id="nvidia/llama-3.2-nv-embedqa-1b-v2",
|
||||||
|
contents=["What is the capital of France?"],
|
||||||
|
task_type="query",
|
||||||
)
|
)
|
||||||
print(f"Embeddings: {response.embeddings}")
|
print(f"Embeddings: {response.embeddings}")
|
||||||
```
|
```
|
Loading…
Add table
Add a link
Reference in a new issue