mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-25 12:02:08 +00:00
test(neuron): added a small script to prune test models
This commit is contained in:
parent
cd477d800c
commit
6706c9b4d9
25
backends/neuron/tests/prune_test_models.py
Normal file
25
backends/neuron/tests/prune_test_models.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
from huggingface_hub import HfApi
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = ArgumentParser()
|
||||||
|
parser.add_argument("--yes", action="store_true", default=False)
|
||||||
|
args = parser.parse_args()
|
||||||
|
api = HfApi()
|
||||||
|
models = api.list_models(search="optimum-internal-testing/neuron-tgi-testing")
|
||||||
|
for model in models:
|
||||||
|
if args.yes:
|
||||||
|
delete = True
|
||||||
|
else:
|
||||||
|
answer = input(f"Do you want to delete {model.id} [y/N] ?")
|
||||||
|
delete = (answer == "y")
|
||||||
|
if delete:
|
||||||
|
api.delete_repo(model.id)
|
||||||
|
print(f"Deleted {model.id}.")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user