bugfix
This commit is contained in:
parent
fcf7d7c0d4
commit
bb9cd90831
@ -87,15 +87,20 @@ class FastVLM:
|
|||||||
'timecost': t2 - t1,
|
'timecost': t2 - t1,
|
||||||
'content': outputs
|
'content': outputs
|
||||||
}
|
}
|
||||||
|
debug(f'Exception happened .......')
|
||||||
|
return None
|
||||||
|
|
||||||
async def generate(self, image_file, prompt):
|
async def generate(self, image_file, prompt):
|
||||||
f = awaitify(self._generate)
|
f = awaitify(self._generate)
|
||||||
return await f(image_file, promot)
|
return await f(image_file, prompt)
|
||||||
|
|
||||||
|
fastvlm = None
|
||||||
def init():
|
def init():
|
||||||
|
global fastvlm
|
||||||
g = ServerEnv()
|
g = ServerEnv()
|
||||||
k = FastVLM()
|
g.fastvlm = fastvlm
|
||||||
g.generate = k.generate
|
fastvlm = FastVLM()
|
||||||
|
g.generate = fastvlm.generate
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
webapp(init)
|
webapp(init)
|
||||||
|
@ -3,5 +3,6 @@ image_path = realpath(params_kw.image_path)
|
|||||||
prompt = params_kw.prompt
|
prompt = params_kw.prompt
|
||||||
debug(f'{image_path=}, {prompt=}')
|
debug(f'{image_path=}, {prompt=}')
|
||||||
d = await generate(image_path, prompt)
|
d = await generate(image_path, prompt)
|
||||||
|
debug(f'{image_path=}, {prompt=}, {d=}')
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user