fix added
Browse files- SkinGPT.py +5 -4
SkinGPT.py
CHANGED
@@ -251,7 +251,8 @@ class SkinGPT4(nn.Module):
|
|
251 |
prompt = """### Skin Diagnosis Analysis ###
|
252 |
<IMAGE>
|
253 |
Could you describe the skin condition in this image?
|
254 |
-
Please provide a detailed analysis including possible diagnoses.
|
|
|
255 |
|
256 |
|
257 |
print(f"\n[DEBUG] Raw Prompt:\n{prompt}")
|
@@ -296,14 +297,14 @@ class SkinGPT4(nn.Module):
|
|
296 |
print(f"\n[DEBUG] Before replacement:")
|
297 |
print(f"Text embeddings shape: {input_embeddings.shape}")
|
298 |
print(f"Visual embeddings shape: {visual_embeds.shape}")
|
299 |
-
|
300 |
-
print(f"Image token embedding (before):\n{input_embeddings[0,
|
301 |
|
302 |
for pos in replace_positions:
|
303 |
input_embeddings[0, pos[1]] = visual_embeds[0]
|
304 |
|
305 |
print(f"\n[DEBUG] After replacement:")
|
306 |
-
print(f"Image token embedding (after):\n{input_embeddings[0,
|
307 |
|
308 |
outputs = self.llama.generate(
|
309 |
inputs_embeds=input_embeddings,
|
|
|
251 |
prompt = """### Skin Diagnosis Analysis ###
|
252 |
<IMAGE>
|
253 |
Could you describe the skin condition in this image?
|
254 |
+
Please provide a detailed analysis including possible diagnoses.
|
255 |
+
### Response:"""
|
256 |
|
257 |
|
258 |
print(f"\n[DEBUG] Raw Prompt:\n{prompt}")
|
|
|
297 |
print(f"\n[DEBUG] Before replacement:")
|
298 |
print(f"Text embeddings shape: {input_embeddings.shape}")
|
299 |
print(f"Visual embeddings shape: {visual_embeds.shape}")
|
300 |
+
print(f"Image token at {replace_positions[0][1].item()}:")
|
301 |
+
print(f"Image token embedding (before):\n{input_embeddings[0, replace_positions[0][1], :5]}...")
|
302 |
|
303 |
for pos in replace_positions:
|
304 |
input_embeddings[0, pos[1]] = visual_embeds[0]
|
305 |
|
306 |
print(f"\n[DEBUG] After replacement:")
|
307 |
+
print(f"Image token embedding (after):\n{input_embeddings[0, replace_positions[0][1], :5]}...")
|
308 |
|
309 |
outputs = self.llama.generate(
|
310 |
inputs_embeds=input_embeddings,
|