chore(scripts): allow to specify quants (#5430)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2025-05-22 11:53:30 +02:00 committed by GitHub
parent 1d1d5627f0
commit 8dcab2f9c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,7 @@ templated_yaml = """
client = OpenAI()
model = os.environ.get("OPENAI_MODEL", "hermes-2-theta-llama-3-8b")
quantization = os.environ.get("QUANTIZATION", "Q4_K_M")
def summarize(text: str) -> str:
@ -69,12 +70,12 @@ if __name__ == "__main__":
if "readme" in file.lower():
readmeFile = file
print(f"Found README file: {readmeFile}")
if "q4_k_m" in file.lower():
if quantization.lower() in file.lower():
file_path = file
if file_path is None:
print("No file with Q4_K_M found, using the first file in the list.")
print(f"No file with {quantization} found, using the first file in the list.")
exit(1)