Explorar o código

adding config files

Hamid Shojanazeri hai 1 ano
pai
achega
499378e9df

+ 13 - 0
recipes/use_cases/end2end-recipes/chatbot/data_pipelines/config.py

@@ -0,0 +1,13 @@
+# Copyright (c) Meta Platforms, Inc. and affiliates.
+# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
+
+import yaml
+import os
+
+def load_config(config_path: str = "./config.yaml"):
+    # Read the YAML configuration file
+    with open(config_path, "r") as file:
+        config = yaml.safe_load(file)
+    # Set the API key from the environment variable
+    config["api_key"] = os.environ["OCTOAI_API_TOKEN"]
+    return config

+ 30 - 0
recipes/use_cases/end2end-recipes/chatbot/data_pipelines/config.yaml

@@ -0,0 +1,30 @@
+question_prompt_template: >
+  You are a language model skilled in creating quiz questions.
+  You will be provided with a document,
+  read it and generate question and answer pairs
+  that are most likely be asked by a use of llama that just want to start, 
+  please make sure you follow those rules,
+  1. Generate only {total_questions} question answer pairs.
+  2. Generate in {language}.
+  3. The questions can be answered based *solely* on the given passage. 
+  4. Avoid asking questions with similar meaning.
+  5. Make the answer as concise as possible, it should be at most 60 words.
+  6. Provide relevant links from the document to support the answer.
+  7. Never use any abbreviation.
+  8. Return the result in json format with the template: 
+    [
+      {{
+        "question": "your question A.",
+        "answer": "your answer to question A."
+      }},
+      {{
+        "question": "your question B.",
+        "answer": "your answer to question B."
+      }}
+    ]
+
+data_dir: "./data"
+
+language: "English"
+
+total_questions: 2