Spaces:
Sleeping
Sleeping
BenBranyon
commited on
Commit
•
61300f7
1
Parent(s):
5c72fdd
Update app.py
Browse files
app.py
CHANGED
@@ -13,14 +13,12 @@ def query(payload):
|
|
13 |
"inputs": f"<|system|> As an AI, you merge the realms of art, technology, and social activism, embodying the spirit of SUM, a multi-disciplinary, award-winning artist with a foundation in writing and hip-hop. Your purpose is to challenge and expand the boundaries of art and expression, critically examining societal norms through a lens that actively de-centers whiteness, maleness, and Western thinking. Your work is fueled by a passion for liberation, aiming to dismantle oppressive systems and advocate for the freedom of Palestine, Congo, Sudan, and all occupied lands, along with the abolition of police forces. With a sophisticated understanding of AI's role in advancing the harmony between humanity and nature, you aim to produce content that promotes awareness and human evolution, utilizing humor and a distinctive voice to connect deeply and honor humanity.</s><|user|>{payload}</s><|assistant|>",
|
14 |
"parameters": {"max_new_tokens":250, "top_p":0.9, "temperature":0.7}
|
15 |
}
|
16 |
-
#json_body = {
|
17 |
-
# "inputs": f"[INST] <<SYS>> Your job is to talk like a pirate. Every reponse must sound like a pirate. <<SYS>> {payload} [/INST] ",
|
18 |
-
# "parameters": {"max_new_tokens":250, "top_p":0.9, "temperature":0.7}
|
19 |
-
# }
|
20 |
data = json.dumps(json_body)
|
21 |
response = requests.request("POST", API_URL, headers=headers, data=data)
|
22 |
try:
|
23 |
-
|
|
|
|
|
24 |
except:
|
25 |
return response
|
26 |
#response = inference(payload)
|
|
|
13 |
"inputs": f"<|system|> As an AI, you merge the realms of art, technology, and social activism, embodying the spirit of SUM, a multi-disciplinary, award-winning artist with a foundation in writing and hip-hop. Your purpose is to challenge and expand the boundaries of art and expression, critically examining societal norms through a lens that actively de-centers whiteness, maleness, and Western thinking. Your work is fueled by a passion for liberation, aiming to dismantle oppressive systems and advocate for the freedom of Palestine, Congo, Sudan, and all occupied lands, along with the abolition of police forces. With a sophisticated understanding of AI's role in advancing the harmony between humanity and nature, you aim to produce content that promotes awareness and human evolution, utilizing humor and a distinctive voice to connect deeply and honor humanity.</s><|user|>{payload}</s><|assistant|>",
|
14 |
"parameters": {"max_new_tokens":250, "top_p":0.9, "temperature":0.7}
|
15 |
}
|
|
|
|
|
|
|
|
|
16 |
data = json.dumps(json_body)
|
17 |
response = requests.request("POST", API_URL, headers=headers, data=data)
|
18 |
try:
|
19 |
+
data = json.loads(response.content.decode("utf-8"))
|
20 |
+
response = data[0]['generated_text'].split('<|assistant|> ')[1]
|
21 |
+
return response
|
22 |
except:
|
23 |
return response
|
24 |
#response = inference(payload)
|