Spaces:
Running
on
A10G
Running
on
A10G
MekkCyber
commited on
Commit
·
d5a3279
1
Parent(s):
00dfc3d
fix readme
Browse files
app.py
CHANGED
|
@@ -72,18 +72,27 @@ base_model:
|
|
| 72 |
|
| 73 |
# Add any original YAML fields except base_model
|
| 74 |
if original_yaml_header:
|
| 75 |
-
|
| 76 |
for line in original_yaml_header.strip().split('\n'):
|
| 77 |
-
if
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
if line.strip().startswith('base_model:'):
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
| 82 |
continue
|
|
|
|
| 83 |
yaml_header += f"\n{line}"
|
| 84 |
# Complete the YAML header
|
| 85 |
yaml_header += "\n---"
|
| 86 |
-
|
| 87 |
# Create the quantization info section
|
| 88 |
quant_info = f"""
|
| 89 |
# {model_name} (Quantized)
|
|
|
|
| 72 |
|
| 73 |
# Add any original YAML fields except base_model
|
| 74 |
if original_yaml_header:
|
| 75 |
+
in_base_model_section = False
|
| 76 |
for line in original_yaml_header.strip().split('\n'):
|
| 77 |
+
# Skip if we're in a base_model section that continues to the next line
|
| 78 |
+
if in_base_model_section:
|
| 79 |
+
if line.strip().startswith('-') or not line.strip() or line.startswith(' '):
|
| 80 |
+
continue
|
| 81 |
+
else:
|
| 82 |
+
in_base_model_section = False
|
| 83 |
+
|
| 84 |
+
# Check for base_model field
|
| 85 |
if line.strip().startswith('base_model:'):
|
| 86 |
+
in_base_model_section = True
|
| 87 |
+
# If base_model has inline value (like "base_model: model_name")
|
| 88 |
+
if ':' in line and len(line.split(':', 1)[1].strip()) > 0:
|
| 89 |
+
in_base_model_section = False
|
| 90 |
continue
|
| 91 |
+
|
| 92 |
yaml_header += f"\n{line}"
|
| 93 |
# Complete the YAML header
|
| 94 |
yaml_header += "\n---"
|
| 95 |
+
|
| 96 |
# Create the quantization info section
|
| 97 |
quant_info = f"""
|
| 98 |
# {model_name} (Quantized)
|