Rulga commited on
Commit
d3a3bab
·
1 Parent(s): 6b8ac6b

Refactor app.py: Add account status check and warning for PRO-only models in model info update

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -29,7 +29,9 @@ from config.settings import (
29
  DEFAULT_MODEL,
30
  EMBEDDING_MODEL,
31
  HF_TOKEN,
32
- MODELS
 
 
33
  )
34
 
35
  # Local imports - source modules
@@ -758,6 +760,11 @@ def update_model_info(model_key):
758
 
759
  model = MODELS[model_key]
760
  account_status = "PRO" if IS_PRO_ACCOUNT else "FREE"
 
 
 
 
 
761
 
762
  return f"""
763
  ### Current Model: {model['name']}
@@ -765,9 +772,7 @@ def update_model_info(model_key):
765
  **Account Type:** {account_status}
766
  **Model ID:** {model['id']}
767
  **Description:** {model['description']}
768
- **Type:** {model['type']}
769
-
770
- {'⚠️ This model requires PRO account' if model_key in PRO_ONLY_MODELS and not IS_PRO_ACCOUNT else ''}
771
  """
772
 
773
  def get_model_details_html(model_key):
 
29
  DEFAULT_MODEL,
30
  EMBEDDING_MODEL,
31
  HF_TOKEN,
32
+ MODELS,
33
+ PRO_ONLY_MODELS,
34
+ IS_PRO_ACCOUNT
35
  )
36
 
37
  # Local imports - source modules
 
760
 
761
  model = MODELS[model_key]
762
  account_status = "PRO" if IS_PRO_ACCOUNT else "FREE"
763
+ is_pro_model = model_key in PRO_ONLY_MODELS
764
+
765
+ warning = ""
766
+ if is_pro_model and not IS_PRO_ACCOUNT:
767
+ warning = "\n\n⚠️ **Warning:** This model requires PRO account. Some features may be limited."
768
 
769
  return f"""
770
  ### Current Model: {model['name']}
 
772
  **Account Type:** {account_status}
773
  **Model ID:** {model['id']}
774
  **Description:** {model['description']}
775
+ **Type:** {model['type']}{warning}
 
 
776
  """
777
 
778
  def get_model_details_html(model_key):