"content":"You are a bot which extracts the description of the LLM model from the following text. Return ONLY the description of the model, and nothing else.\n"+text,
},
],
model=model,
)
returnchat_completion.choices[0].message.content
defformat_description(description):
return'\n'.join(description.split('\n'))
# Example usage
if__name__=="__main__":
# Get repoid from argv[0]
repo_id=sys.argv[1]
token=""# Replace with your Hugging Face token if needed
fs=HfFileSystem()
all_files=fs.ls(repo_id,detail=False)
print(all_files)
# Find a file that has Q4_K in the name
file_path=None
file_name=None
readmeFile=None
forfileinall_files:
print(f"File found: {file}")
if"readme"infile.lower():
readmeFile=file
print(f"Found README file: {readmeFile}")
if"q4_k_m"infile.lower():
file_path=file
iffile_pathisNone:
print("No file with Q4_K_M found, using the first file in the list.")
exit(1)
# Extract file from full path (is the last element)