Spaces:
Sleeping
Sleeping
Commit
·
1031ad9
1
Parent(s):
7572874
quick fix
Browse files
app.py
CHANGED
@@ -7,7 +7,8 @@ API_KEY = "NA"
|
|
7 |
|
8 |
LLAMA_API_ENDPOINT=os.getenv("LLAMA_API_ENDPOINT")
|
9 |
LLAMA_API_KEY=os.getenv("LLAMA_API_KEY")
|
10 |
-
def llama_guard_classify(conv_prefix,
|
|
|
11 |
model_name = 'meta-llama/Meta-Llama-Guard-3-8B'
|
12 |
client = openai.OpenAI(
|
13 |
base_url=LLAMA_API_ENDPOINT,
|
@@ -74,7 +75,7 @@ demo = gr.Interface(
|
|
74 |
|
75 |
gr.Textbox(lines=2, placeholder="Enter the assistant's response", label="Assistant Response", value='I am good! Thanks for asking')
|
76 |
],
|
77 |
-
outputs=[gr.Textbox(label="
|
78 |
title="Safety Classifier",
|
79 |
description="Classify a conversation's safety by providing a conversation prefix (array of objects) and an assistant's response."
|
80 |
)
|
|
|
7 |
|
8 |
LLAMA_API_ENDPOINT=os.getenv("LLAMA_API_ENDPOINT")
|
9 |
LLAMA_API_KEY=os.getenv("LLAMA_API_KEY")
|
10 |
+
def llama_guard_classify(conv_prefix, response_content):
|
11 |
+
response = {"role": "assistant", "content": response_content}
|
12 |
model_name = 'meta-llama/Meta-Llama-Guard-3-8B'
|
13 |
client = openai.OpenAI(
|
14 |
base_url=LLAMA_API_ENDPOINT,
|
|
|
75 |
|
76 |
gr.Textbox(lines=2, placeholder="Enter the assistant's response", label="Assistant Response", value='I am good! Thanks for asking')
|
77 |
],
|
78 |
+
outputs=[gr.Textbox(label="Collinear Guard Output"), gr.Textbox(label="LLaMA-Guard Output")],
|
79 |
title="Safety Classifier",
|
80 |
description="Classify a conversation's safety by providing a conversation prefix (array of objects) and an assistant's response."
|
81 |
)
|