DawnC commited on
Commit
34ac181
1 Parent(s): 533532a

Update breed_recommendation.py

Browse files
Files changed (1) hide show
  1. breed_recommendation.py +15 -15
breed_recommendation.py CHANGED
@@ -398,9 +398,9 @@ def create_recommendation_tab(UserPreferences, get_breed_recommendations, format
398
  # result = format_recommendation_html(final_recommendations, is_description_search=True)
399
  # return [gr.update(value=result), gr.update(visible=False)]
400
 
401
- # except Exception as e:
402
- # error_msg = f"Error processing your description. Details: {str(e)}"
403
- # return [gr.update(value=error_msg), gr.update(visible=False)]
404
 
405
 
406
  def on_description_search(description: str):
@@ -581,18 +581,18 @@ def create_recommendation_tab(UserPreferences, get_breed_recommendations, format
581
  'temperament': smart_rec.get('scores', {}).get('temperament', 0.0)
582
  }
583
 
584
- final_recommendations.append({
585
- 'rank': 0,
586
- 'breed': breed_name,
587
- 'scores': scores,
588
- 'base_score': round(base_score, 4),
589
- 'bonus_score': round(bonus_score, 4),
590
- 'final_score': round(final_score, 4),
591
- 'match_reason': ' • '.join(bonus_reasons) if bonus_reasons else "Standard match",
592
- 'info': breed_info,
593
- 'noise_info': breed_noise_info.get(breed_name, {}),
594
- 'health_info': breed_health_info.get(breed_name, {})
595
- })
596
 
597
  # 排序並更新排名
598
  if final_recommendations:
 
398
  # result = format_recommendation_html(final_recommendations, is_description_search=True)
399
  # return [gr.update(value=result), gr.update(visible=False)]
400
 
401
+ # except Exception as e:
402
+ # error_msg = f"Error processing your description. Details: {str(e)}"
403
+ # return [gr.update(value=error_msg), gr.update(visible=False)]
404
 
405
 
406
  def on_description_search(description: str):
 
581
  'temperament': smart_rec.get('scores', {}).get('temperament', 0.0)
582
  }
583
 
584
+ final_recommendations.append({
585
+ 'rank': 0,
586
+ 'breed': breed_name,
587
+ 'scores': scores,
588
+ 'base_score': round(base_score, 4),
589
+ 'bonus_score': round(bonus_score, 4),
590
+ 'final_score': round(final_score, 4),
591
+ 'match_reason': ' • '.join(bonus_reasons) if bonus_reasons else "Standard match",
592
+ 'info': breed_info,
593
+ 'noise_info': breed_noise_info.get(breed_name, {}),
594
+ 'health_info': breed_health_info.get(breed_name, {})
595
+ })
596
 
597
  # 排序並更新排名
598
  if final_recommendations: