Spaces:
Running
Running
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
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1962 |
|
| 1963 |
# Show searching status
|
| 1964 |
-
yield
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1974 |
elif not files:
|
| 1975 |
# No files found
|
| 1976 |
-
yield
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1977 |
else:
|
| 1978 |
# Success - format choices
|
| 1979 |
choices = [format_file_choice(f) for f in files]
|
| 1980 |
-
yield
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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(
|