Spaces:
Runtime error
Runtime error
updating for palm changes
Browse files- src/llm/palmLLM.py +13 -7
src/llm/palmLLM.py
CHANGED
@@ -45,13 +45,19 @@ class PalmLLM(LLM):
|
|
45 |
stop=self.stop
|
46 |
text=palm.generate_text(prompt=prompt,stop_sequences=self.stop,
|
47 |
temperature=self.temperature, max_output_tokens=self.max_tokens,
|
48 |
-
safety_settings=[{"category":0,"threshold":4},
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
)
|
56 |
print("Response from palm",text)
|
57 |
val=text.result
|
|
|
45 |
stop=self.stop
|
46 |
text=palm.generate_text(prompt=prompt,stop_sequences=self.stop,
|
47 |
temperature=self.temperature, max_output_tokens=self.max_tokens,
|
48 |
+
# safety_settings=[{"category":0,"threshold":4},
|
49 |
+
# {"category":1,"threshold":4},
|
50 |
+
# {"category":2,"threshold":4},
|
51 |
+
# {"category":3,"threshold":4},
|
52 |
+
# {"category":4,"threshold":4},
|
53 |
+
# {"category":5,"threshold":4},
|
54 |
+
# {"category":6, "threshold":4}]
|
55 |
+
safety_settings=[{"category":"HARM_CATEGORY_DEROGATORY","threshold":4},
|
56 |
+
{"category":"HARM_CATEGORY_TOXICITY","threshold":4},
|
57 |
+
{"category":"HARM_CATEGORY_VIOLENCE","threshold":4},
|
58 |
+
{"category":"HARM_CATEGORY_SEXUAL","threshold":4},
|
59 |
+
{"category":"HARM_CATEGORY_MEDICAL","threshold":4},
|
60 |
+
{"category":"HARM_CATEGORY_DANGEROUS","threshold":4}]
|
61 |
)
|
62 |
print("Response from palm",text)
|
63 |
val=text.result
|