Spaces:
Sleeping
Sleeping
Commit
·
a4bfb4f
1
Parent(s):
a9f948c
.DS_Store
CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
|
|
app.py
CHANGED
@@ -130,8 +130,10 @@ def diagnose_plant_from_image(uploaded_image: Image.Image) -> str:
|
|
130 |
outputs = VISION_MODEL.generate(**inputs, max_new_tokens=48, use_cache=True)
|
131 |
|
132 |
response = PROCESSOR.batch_decode(outputs, skip_special_tokens=True)[0]
|
|
|
133 |
# Clean up the model's output to get only the diagnosis
|
134 |
answer_start_index = response.rfind("model\n")
|
|
|
135 |
if answer_start_index != -1:
|
136 |
return response[answer_start_index + len("model\n"):].strip()
|
137 |
return "Could not parse diagnosis from model output."
|
|
|
130 |
outputs = VISION_MODEL.generate(**inputs, max_new_tokens=48, use_cache=True)
|
131 |
|
132 |
response = PROCESSOR.batch_decode(outputs, skip_special_tokens=True)[0]
|
133 |
+
print(response)
|
134 |
# Clean up the model's output to get only the diagnosis
|
135 |
answer_start_index = response.rfind("model\n")
|
136 |
+
print(answer_start_index)
|
137 |
if answer_start_index != -1:
|
138 |
return response[answer_start_index + len("model\n"):].strip()
|
139 |
return "Could not parse diagnosis from model output."
|