Spaces:
Sleeping
Sleeping
added llama guard remove asyc
Browse files
app.py
CHANGED
@@ -76,7 +76,7 @@ marketing_email_prompt = """Below is a product and description, please write a m
|
|
76 |
### Marketing Email:
|
77 |
{}"""
|
78 |
|
79 |
-
|
80 |
user_reques = marketing_email_prompt.format(
|
81 |
product, # product
|
82 |
description, # description
|
@@ -90,7 +90,7 @@ async def greet(product,description):
|
|
90 |
#config = RailsConfig.from_content(yaml_content=YAML_CONFIG)
|
91 |
app = LLMRails(config=config, llm=client)
|
92 |
options = {"output_vars": ["triggered_input_rail", "triggered_output_rail"]}
|
93 |
-
output =
|
94 |
print(output)
|
95 |
warning_message = output.output_data["triggered_input_rail"] or output.output_data["triggered_output_rail"]
|
96 |
if warning_message:
|
|
|
76 |
### Marketing Email:
|
77 |
{}"""
|
78 |
|
79 |
+
def greet(product,description):
|
80 |
user_reques = marketing_email_prompt.format(
|
81 |
product, # product
|
82 |
description, # description
|
|
|
90 |
#config = RailsConfig.from_content(yaml_content=YAML_CONFIG)
|
91 |
app = LLMRails(config=config, llm=client)
|
92 |
options = {"output_vars": ["triggered_input_rail", "triggered_output_rail"]}
|
93 |
+
output = app.generate(messages=messages, options=options)
|
94 |
print(output)
|
95 |
warning_message = output.output_data["triggered_input_rail"] or output.output_data["triggered_output_rail"]
|
96 |
if warning_message:
|