Luigi commited on
Commit
c732f74
Β·
1 Parent(s): dda4451

fix: make custom GGUF status messages visible

Browse files

- Fix discover_custom_files to properly show status messages by making
the status textbox visible on all yield statements
- Add gr.update(visible=True, value=...) for all status updates
- Ensures users can see search progress, errors, and success messages

Files changed (1) hide show
  1. app.py +25 -5
app.py CHANGED
@@ -1958,10 +1958,18 @@ def create_interface():
1958
  def discover_custom_files(repo_id):
1959
  """Discover GGUF files in the custom repo."""
1960
  if not repo_id or "/" not in repo_id:
1961
- return [], [], "Enter a valid HuggingFace Repo ID above (e.g., unsloth/DeepSeek-R1-Distill-Qwen-7B-GGUF)"
 
 
 
 
1962
 
1963
  # Show searching status
1964
- yield gr.update(choices=["Searching..."], value=None, interactive=False), [], "πŸ” Searching for GGUF files..."
 
 
 
 
1965
 
1966
  # Small delay to simulate search
1967
  time_module.sleep(0.5)
@@ -1970,14 +1978,26 @@ def create_interface():
1970
 
1971
  if error:
1972
  # Error - show empty dropdown with error message
1973
- yield gr.update(choices=[], value=None, interactive=True), [], f"❌ {error}"
 
 
 
 
1974
  elif not files:
1975
  # No files found
1976
- yield gr.update(choices=[], value=None, interactive=True), [], "❌ No GGUF files found in this repository"
 
 
 
 
1977
  else:
1978
  # Success - format choices
1979
  choices = [format_file_choice(f) for f in files]
1980
- yield gr.update(choices=choices, value=choices[0] if choices else None, interactive=True), files, "βœ… Files discovered! Select one and click 'Load Selected Model'"
 
 
 
 
1981
 
1982
  # Manual discover button
1983
  discover_btn.click(
 
1958
  def discover_custom_files(repo_id):
1959
  """Discover GGUF files in the custom repo."""
1960
  if not repo_id or "/" not in repo_id:
1961
+ return (
1962
+ gr.update(choices=[], value=None, interactive=True),
1963
+ [],
1964
+ gr.update(visible=True, value="Enter a valid HuggingFace Repo ID above (e.g., unsloth/DeepSeek-R1-Distill-Qwen-7B-GGUF)")
1965
+ )
1966
 
1967
  # Show searching status
1968
+ yield (
1969
+ gr.update(choices=["Searching..."], value=None, interactive=False),
1970
+ [],
1971
+ gr.update(visible=True, value="πŸ” Searching for GGUF files...")
1972
+ )
1973
 
1974
  # Small delay to simulate search
1975
  time_module.sleep(0.5)
 
1978
 
1979
  if error:
1980
  # Error - show empty dropdown with error message
1981
+ yield (
1982
+ gr.update(choices=[], value=None, interactive=True),
1983
+ [],
1984
+ gr.update(visible=True, value=f"❌ {error}")
1985
+ )
1986
  elif not files:
1987
  # No files found
1988
+ yield (
1989
+ gr.update(choices=[], value=None, interactive=True),
1990
+ [],
1991
+ gr.update(visible=True, value="❌ No GGUF files found in this repository")
1992
+ )
1993
  else:
1994
  # Success - format choices
1995
  choices = [format_file_choice(f) for f in files]
1996
+ yield (
1997
+ gr.update(choices=choices, value=choices[0] if choices else None, interactive=True),
1998
+ files,
1999
+ gr.update(visible=True, value="βœ… Files discovered! Select one and click 'Load Selected Model'")
2000
+ )
2001
 
2002
  # Manual discover button
2003
  discover_btn.click(