bugfix
This commit is contained in:
parent
a9eb8c1a30
commit
9bffe4b983
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
from ahserver.configuredServer import ConfiguredServer
|
||||
|
||||
if __name__ == '__main__':
|
||||
server = ConfiguredServer()
|
||||
server.run()
|
@ -24,6 +24,10 @@ class Gemma3LLM(MMChatLLM):
|
||||
llm_register("gemma-3", Gemma3LLM)
|
||||
|
||||
if __name__ == '__main__':
|
||||
def get_stream_text(chunk):
|
||||
chunk = chunk[6:]
|
||||
d = json.loads(chunk)
|
||||
return d['choices'][0]['delta']['content']
|
||||
gemma3 = Gemma3LLM('/share/models/google/gemma-3-4b-it')
|
||||
session = {}
|
||||
while True:
|
||||
@ -35,7 +39,7 @@ if __name__ == '__main__':
|
||||
print('input image path')
|
||||
imgpath=input()
|
||||
for d in gemma3.stream_generate(session, p, image_path=imgpath):
|
||||
if not d['done']:
|
||||
if not d['DONE']:
|
||||
print(d['text'], end='', flush=True)
|
||||
else:
|
||||
x = {k:v for k,v in d.items() if k != 'text'}
|
||||
|
Loading…
Reference in New Issue
Block a user