Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -419,14 +419,12 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
|
|
419 |
"model": model_llm
|
420 |
}).json()
|
421 |
print("RESPONSE TRY",response)
|
|
|
|
|
|
|
422 |
except:
|
423 |
print("DOESN'T WORK")
|
424 |
-
|
425 |
-
|
426 |
-
reply = response["choices"][0]["message"]["content"]
|
427 |
-
messages.append({"role": "assistant", "content": reply})
|
428 |
-
|
429 |
-
output.append({"Mode": "Image", "type": max_label, "prediction_value": max_rounded_prediction, "content": reply})
|
430 |
elif max_rounded_prediction < 0.5:
|
431 |
output.append({"Mode": "Image", "type": "Not predictable", "prediction_value": max_rounded_prediction, "content": "Seems like the prediction rate is too low due to that won't be able to predict the type of material. Try again with a cropped image or different one"})
|
432 |
|
|
|
419 |
"model": model_llm
|
420 |
}).json()
|
421 |
print("RESPONSE TRY",response)
|
422 |
+
reply = response["choices"][0]["message"]["content"]
|
423 |
+
messages.append({"role": "assistant", "content": reply})
|
424 |
+
output.append({"Mode": "Image", "type": max_label, "prediction_value": max_rounded_prediction, "content": reply})
|
425 |
except:
|
426 |
print("DOESN'T WORK")
|
427 |
+
|
|
|
|
|
|
|
|
|
|
|
428 |
elif max_rounded_prediction < 0.5:
|
429 |
output.append({"Mode": "Image", "type": "Not predictable", "prediction_value": max_rounded_prediction, "content": "Seems like the prediction rate is too low due to that won't be able to predict the type of material. Try again with a cropped image or different one"})
|
430 |
|