bibibi12345 commited on
Commit
f5ecd80
·
1 Parent(s): 61016a0

added openai model back

Browse files
app/api_helpers.py CHANGED
@@ -40,7 +40,7 @@ def create_generation_config(request: OpenAIRequest) -> Dict[str, Any]:
40
  types.SafetySetting(category="HARM_CATEGORY_DANGEROUS_CONTENT", threshold="OFF"),
41
  types.SafetySetting(category="HARM_CATEGORY_SEXUALLY_EXPLICIT", threshold="OFF"),
42
  types.SafetySetting(category="HARM_CATEGORY_HARASSMENT", threshold="OFF"),
43
- types.SafetySetting(category="HARM_CATEGORY_CIVIC_INTEGRITY", threshold="NONE")
44
  ]
45
  return config
46
 
 
40
  types.SafetySetting(category="HARM_CATEGORY_DANGEROUS_CONTENT", threshold="OFF"),
41
  types.SafetySetting(category="HARM_CATEGORY_SEXUALLY_EXPLICIT", threshold="OFF"),
42
  types.SafetySetting(category="HARM_CATEGORY_HARASSMENT", threshold="OFF"),
43
+ types.SafetySetting(category="HARM_CATEGORY_CIVIC_INTEGRITY", threshold="OFF")
44
  ]
45
  return config
46
 
app/routes/chat_api.py CHANGED
@@ -163,7 +163,7 @@ async def chat_completions(fastapi_request: Request, request: OpenAIRequest, api
163
  {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"},
164
  {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"},
165
  {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"},
166
- {"category": 'HARM_CATEGORY_CIVIC_INTEGRITY', "threshold": 'NONE'}
167
  ]
168
 
169
  openai_params = {
 
163
  {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"},
164
  {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"},
165
  {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"},
166
+ {"category": 'HARM_CATEGORY_CIVIC_INTEGRITY', "threshold": 'OFF'}
167
  ]
168
 
169
  openai_params = {
app/routes/models_api.py CHANGED
@@ -90,6 +90,8 @@ async def list_models(fastapi_request: Request, api_key: str = Depends(get_api_k
90
  for model_id in raw_vertex_models: # Iterate through the original list of base models
91
  if EXPERIMENTAL_MARKER in model_id:
92
  suffixed_id = f"{model_id}{OPENAI_DIRECT_SUFFIX}"
 
 
93
  # Check if already added (e.g. if remote config somehow already listed it)
94
  if not any(m['id'] == suffixed_id for m in dynamic_models_data):
95
  dynamic_models_data.append({
 
90
  for model_id in raw_vertex_models: # Iterate through the original list of base models
91
  if EXPERIMENTAL_MARKER in model_id:
92
  suffixed_id = f"{model_id}{OPENAI_DIRECT_SUFFIX}"
93
+ print("===========")
94
+ print(suffixed_id)
95
  # Check if already added (e.g. if remote config somehow already listed it)
96
  if not any(m['id'] == suffixed_id for m in dynamic_models_data):
97
  dynamic_models_data.append({