bugfix
This commit is contained in:
parent
adb3d9b30d
commit
1e28ed2c98
@ -1,27 +1,14 @@
|
|||||||
params_kw.action = 't2v'
|
|
||||||
lctype =
|
|
||||||
userid = await get_user()
|
userid = await get_user()
|
||||||
if userid is None:
|
if userid is None:
|
||||||
return openai_403
|
return openai_403
|
||||||
|
|
||||||
if params_kw.model is None:
|
if params_kw.llmid is None:
|
||||||
return openai_400()
|
return openai_400()
|
||||||
|
|
||||||
llms = await get_llm_by_model(params_kw.model)
|
|
||||||
if llms is None:
|
|
||||||
debug(f'{params_kw.model=} not found in llm with error')
|
|
||||||
return openai_400()
|
|
||||||
if len(llms) == 0:
|
|
||||||
debug(f'{params_kw.model=} not found in llm')
|
|
||||||
return openai_400()
|
|
||||||
llm = llms[0]
|
|
||||||
params_kw.llmid = llm.id
|
|
||||||
|
|
||||||
f = await checkCustomerBalance(params_kw.llmid, userorgid)
|
f = await checkCustomerBalance(params_kw.llmid, userorgid)
|
||||||
if not f:
|
if not f:
|
||||||
return openai_429()
|
return openai_429()
|
||||||
|
|
||||||
model = params_kw.model
|
|
||||||
env = request._run_ns
|
env = request._run_ns
|
||||||
async with get_sor.context(env, 'llmage') as sor:
|
return await inference(request, env=env)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user