Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,15 @@ HF_MODEL_ID = os.environ.get("HF_MODEL_ID", "google/flan-t5-xxl")
|
|
| 11 |
|
| 12 |
# Load prompt templates
|
| 13 |
with open("prompts.yaml", 'r') as stream:
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Define the get_motivational_quote tool
|
| 17 |
def get_motivational_quote():
|
|
|
|
| 11 |
|
| 12 |
# Load prompt templates
|
| 13 |
with open("prompts.yaml", 'r') as stream:
|
| 14 |
+
all_prompts = yaml.safe_load(stream)
|
| 15 |
+
prompt_templates = all_prompts["prompts"] # Access the nested 'prompts' dictionary
|
| 16 |
+
|
| 17 |
+
# Now you can access prompt_templates["default"], prompt_templates["system_prompt"], etc.
|
| 18 |
+
prompt_template = PromptTemplate(
|
| 19 |
+
input_variables=["user_input", "tool_names", "tools"],
|
| 20 |
+
template=prompt_templates["default"] # This will now work!
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
|
| 24 |
# Define the get_motivational_quote tool
|
| 25 |
def get_motivational_quote():
|