VincentGOURBIN commited on
Commit
17f4940
·
verified ·
1 Parent(s): 1be0f87

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -240,6 +240,7 @@ else:
240
  """
241
  return _generate_avatar_impl(if1, would1, if2, would2, if3, would3, if4, would4, if5, would5, language, quality)
242
 
 
243
  def _generate_avatar_impl(if1, would1, if2, would2, if3, would3, if4, would4, if5, would5, language, quality):
244
  translations = get_translations()
245
  t = translations.get(language, translations["en"])
@@ -647,6 +648,7 @@ Conversation: {conversation_text}"""
647
  fallback_prompt = "Artistic character portrait of a unique individual. High-quality digital art, fantasy style, detailed illustration with dramatic lighting"
648
  return fallback_prompt, [('style', 'artistic portrait')]
649
 
 
650
  def generate_avatar_from_chat(history: list, language: str = "en", quality: str = "normal"):
651
  """
652
  Generate avatar from conversation history with AI assistant.
 
240
  """
241
  return _generate_avatar_impl(if1, would1, if2, would2, if3, would3, if4, would4, if5, would5, language, quality)
242
 
243
+ @spaces.GPU() if HF_SPACES else lambda x: x
244
  def _generate_avatar_impl(if1, would1, if2, would2, if3, would3, if4, would4, if5, would5, language, quality):
245
  translations = get_translations()
246
  t = translations.get(language, translations["en"])
 
648
  fallback_prompt = "Artistic character portrait of a unique individual. High-quality digital art, fantasy style, detailed illustration with dramatic lighting"
649
  return fallback_prompt, [('style', 'artistic portrait')]
650
 
651
+ @spaces.GPU() if HF_SPACES else lambda x: x
652
  def generate_avatar_from_chat(history: list, language: str = "en", quality: str = "normal"):
653
  """
654
  Generate avatar from conversation history with AI assistant.