Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
infwinston committed Jan 3, 2024
1 parent 939c115 commit bda00f5
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions fastchat/serve/api_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,16 @@ def gemini_api_stream_iter(model_name, conv, temperature, top_p, max_new_tokens)
}

safety_settings = [
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_NONE"
},
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "BLOCK_NONE"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"threshold": "BLOCK_NONE"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "BLOCK_NONE"
},
{"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_NONE"},
{"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_NONE"},
{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "BLOCK_NONE"},
{"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_NONE"},
]
model = genai.GenerativeModel(model_name=model_name,
generation_config=generation_config,
safety_settings=safety_settings)
model = genai.GenerativeModel(
model_name=model_name,
generation_config=generation_config,
safety_settings=safety_settings,
)
history = []
for role, message in conv.messages[:-2]:
history.append({"role": role, "parts": message})
Expand Down

0 comments on commit bda00f5

Please sign in to comment.