mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-02 08:20:06 +00:00
fix register
This commit is contained in:
parent
2c9d624910
commit
13c7c5b6a1
3 changed files with 80 additions and 15 deletions
24
tests/integration/datasets/test_datasets.py
Normal file
24
tests/integration/datasets/test_datasets.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
import base64
|
||||
import mimetypes
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
# How to run this test:
|
||||
#
|
||||
# LLAMA_STACK_CONFIG="template-name" pytest -v tests/integration/datasets
|
||||
|
||||
|
||||
def test_register_dataset(llama_stack_client):
|
||||
dataset = llama_stack_client.datasets.register(
|
||||
purpose="eval/messages-answer",
|
||||
source={"type": "uri", "uri": "huggingface://llamastack/simpleqa?split=train"},
|
||||
)
|
||||
print(dataset)
|
||||
15
tests/integration/datasets/test_script.py
Normal file
15
tests/integration/datasets/test_script.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from llama_stack_client import LlamaStackClient
|
||||
from rich.pretty import pprint
|
||||
|
||||
|
||||
def test_register_dataset():
|
||||
client = LlamaStackClient(base_url="http://localhost:8321")
|
||||
dataset = client.datasets.register(
|
||||
purpose="eval/messages-answer",
|
||||
source={"type": "uri", "uri": "huggingface://llamastack/simpleqa?split=train"},
|
||||
)
|
||||
pprint(dataset)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_register_dataset()
|
||||
Loading…
Add table
Add a link
Reference in a new issue