Skip to content

Commit 2eaa709

Browse files
committed
Merge branch 'visual_only2' of https://github.com/ModelTC/lightllm into visual_only2
2 parents b673a36 + 62f80c4 commit 2eaa709

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lightllm/models/qwen_vl/layer_infer/pre_layer_infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def context_forward(self, input_ids, infer_state: LlamaInferStateInfo, layer_wei
5454
continue
5555
# pull the img_embeds by uid from shm or afs
5656
if self.args.enable_remote_vit:
57-
embed = read_afs(get_shm_name_embed(img["uuid"]))
57+
embed = read_afs(get_shm_name_embed(img["uuid"], self.args.image_embed_dir))
5858
else:
5959
embed = read_shm(get_shm_name_embed(img["uuid"]))
6060
img_weight.append(bytes2tensor(embed).cuda().reshape(img["token_num"], -1))

lightllm/server/embed_cache/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def create_shm(name, data):
4141
print("Warning create shm {} failed because of FileExistsError!".format(name))
4242

4343

44-
def create_afs(name, data):
44+
def create_afs(name, data, path):
4545
try:
4646
data_size = len(data)
47-
path = os.path.join("/mtc/sangchengmeng/afs", name)
47+
path = os.path.join(path, name)
4848
with open(path, "xb") as f:
4949
mem_view = memoryview(data)
5050
f.write(mem_view[:data_size])
@@ -60,7 +60,7 @@ def read_shm(name):
6060
return data
6161

6262

63-
def read_afs(name: str, base_dir: str = "/mtc/sangchengmeng/afs") -> bytes:
63+
def read_afs(name: str, base_dir) -> bytes:
6464

6565
path = Path(base_dir) / name
6666
return path.read_bytes()

lightllm/server/visualserver/model_infer/model_rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def exposed_encode(self, images: List[ImageItem]):
122122
start, end = valid_ids[i]
123123
cur_embed_bytes = tensor2bytes(all_img_embeds[start:end])
124124
if self.args.enable_remote_vit:
125-
create_afs(get_shm_name_embed(uid), cur_embed_bytes)
125+
create_afs(get_shm_name_embed(uid), cur_embed_bytes, self.args.image_embed_dir)
126126
else:
127127
create_shm(get_shm_name_embed(uid), cur_embed_bytes)
128128
ids_to_set.append(uid)

0 commit comments

Comments
 (0)