llm-applications

Форк
0
/
without-context-small.json 
27 строк · 4.4 Кб
1
{
2
    "config": {
3
        "experiment_name": "without-context-small",
4
        "data_path": "/home/ray/ray-assistant/datasets/eval-dataset-v1.jsonl",
5
        "chunk_size": 100,
6
        "chunk_overlap": 50,
7
        "num_chunks": 0,
8
        "embedding_model_name": "thenlper/gte-base",
9
        "llm": "meta-llama/Llama-2-70b-chat-hf",
10
        "temperature": 0.0,
11
        "max_context_length": 4096,
12
        "system_content": "Answer the query using the context provided. Be succinct.",
13
        "assistant_content": ""
14
    },
15
    "results": [
16
        {
17
            "question": "I\u2019m struggling a bit with Ray Data type conversions when I do map_batches. Any advice?",
18
            "sources": [],
19
            "answer": "Sure, I can help you with that! Ray Data type conversions can sometimes be tricky when working with `map_batches`. Here are a few tips that might be helpful:\n\n1. Use the `ray.data.convert` function: This function can be used to convert a Ray Data object to a different data type. For example, if you have a Ray Data object of type `int` and you want to convert it to a type `float`, you can use the following code:\n```\nimport ray\n\n# Create a Ray Data object of type int\ndata = ray.data.IntVector([1, 2, 3])\n\n# Convert the data to a type float\nconverted_data = ray.data.convert(data, ray.data.float32)\n```\n2. Use the `map_batches` method with a custom function: You can also use a custom function to perform type conversions when mapping over a Ray Data object. Here's an example:\n```\nimport ray\n\n# Create a Ray Data object of type int\ndata = ray.data.IntVector([1, 2, 3])\n\n# Define a custom function to convert the data to a type float\ndef convert_to_float(item):\n    return float(item)\n\n# Map over the data using the custom function\nfloat_data = data.map_batches(convert_to_float)\n```\nIn this example, the `convert_to_float` function takes an item from the Ray Data object and returns its float equivalent. The `map_batches` method then applies this function to each item in the data object, resulting in a new Ray Data object of type `float`.\n\n3. Use the `ray.data.to_numpy` method: If you want to convert a Ray Data object to a NumPy array, you can use the `ray.data.to_numpy` method. This method returns a NumPy array with the same data as the Ray Data object. Here's an example:\n```\nimport ray\nimport numpy as np\n\n# Create a Ray Data object of type int\ndata = ray.data.IntVector([1, 2, 3])\n\n# Convert the data to a NumPy array\nnumpy_data = ray.data.to_numpy(data)\n\n# Convert the NumPy array to a type float\nfloat_data = numpy_data.astype(np.float32)\n```\nIn this example, the `to_numpy` method is used to convert the Ray Data object to a NumPy array. The resulting NumPy array is then converted to a type float using the `astype` method.\n\nI hope these tips are helpful! Let me know if you have any further questions."
20
        },
21
        {
22
            "question": "How does autoscaling work in a Ray Serve application?",
23
            "sources": [],
24
            "answer": "Autoscaling in a Ray Serve application works by using the Ray Autoscaler to automatically adjust the number of worker nodes in the cluster based on the current workload. The Autoscaler uses a variety of metrics, such as CPU utilization and task queues, to determine when to add or remove worker nodes.\n\nHere's a high-level overview of how autoscaling works in a Ray Serve application:\n\n1. The Autoscaler periodically collects metrics from the worker nodes in the cluster, such as CPU utilization and task queues.\n2. The Autoscaler uses these metrics to determine the current workload and whether the cluster is underutilized or overutilized.\n3. If the cluster is underutilized, the Autoscaler may decide to remove worker nodes to save resources.\n4. If the cluster is overutilized, the Autoscaler may decide to add worker nodes to handle the increased workload.\n5. The Autoscaler then sends a request to the Ray Cluster Manager to add or remove worker nodes as needed.\n6. The Ray Cluster Manager then provisions new worker nodes or removes existing worker nodes from the cluster.\n7. The Autoscaler monitors the cluster again after a few minutes to ensure that the desired number of worker nodes is running and that the workload is being handled effectively.\n\nBy using autoscaling in a Ray Serve application, you can ensure that your application can handle changes in workload without manual intervention, and that you are using your resources efficiently."
25
        }
26
    ]
27
}
28

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.