Spaces:
Running
on
Zero
Running
on
Zero
Update breed_recommendation_enhanced.py
Browse files
breed_recommendation_enhanced.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from typing import Dict, List, Any, Optional
|
3 |
import traceback
|
|
|
4 |
from semantic_breed_recommender import get_breed_recommendations_by_description, get_enhanced_recommendations_with_unified_scoring
|
5 |
from natural_language_processor import get_nlp_processor
|
6 |
from recommendation_html_format import format_unified_recommendation_html
|
@@ -477,6 +478,7 @@ def create_recommendation_tab(
|
|
477 |
print(f"[DESC][VALIDATE][WARN] {str(e)}")
|
478 |
return gr.update(visible=False), True
|
479 |
|
|
|
480 |
def find_breeds_by_description(description_text):
|
481 |
"""Find breeds based on description and persist history"""
|
482 |
try:
|
@@ -637,4 +639,4 @@ def create_recommendation_tab(
|
|
637 |
'criteria_results': locals().get('criteria_results'),
|
638 |
'description_results': locals().get('description_results'),
|
639 |
'description_input': locals().get('description_input')
|
640 |
-
}
|
|
|
1 |
import gradio as gr
|
2 |
from typing import Dict, List, Any, Optional
|
3 |
import traceback
|
4 |
+
import spaces
|
5 |
from semantic_breed_recommender import get_breed_recommendations_by_description, get_enhanced_recommendations_with_unified_scoring
|
6 |
from natural_language_processor import get_nlp_processor
|
7 |
from recommendation_html_format import format_unified_recommendation_html
|
|
|
478 |
print(f"[DESC][VALIDATE][WARN] {str(e)}")
|
479 |
return gr.update(visible=False), True
|
480 |
|
481 |
+
@spaces.GPU
|
482 |
def find_breeds_by_description(description_text):
|
483 |
"""Find breeds based on description and persist history"""
|
484 |
try:
|
|
|
639 |
'criteria_results': locals().get('criteria_results'),
|
640 |
'description_results': locals().get('description_results'),
|
641 |
'description_input': locals().get('description_input')
|
642 |
+
}
|