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