testbot commited on
Commit
7db56b8
β€’
1 Parent(s): 93b7cb2
Files changed (1) hide show
  1. app.py +19 -18
app.py CHANGED
@@ -63,26 +63,26 @@ def run(
63
  )
64
  return
65
 
66
- total_size = sum(
67
- file.size
68
- for file in model_info.siblings
69
- if file.rfilename.endswith(".pt") or file.rfilename.endswith(".bin")
70
- )
71
- if total_size > MAX_REPO_SIZE:
72
- yield _log(
73
- f"""
74
- ### Unprocessable 😒😒😒
75
-
76
- Model {model_id} is too big and cannot be processed in this Space. This Space needs to be able to load the model in memory before converting it. To avoid a memory issue, we do not process models bigger than {MAX_REPO_SIZE}b.
77
-
78
- You have 2 options:
79
- - [Duplicate this Space](https://huggingface.co/spaces/Wauplin/bloomz.cpp-converter?duplicate=true) and assign a bigger machine. You will need to set 'MAX_REPO_SIZE' as a secret to overwrite the default value. Once you are done, remove the upgraded hardware and/or delete the Space.
80
- - Manually convert the weights by following [this guide](https://github.com/NouamaneTazi/bloomz.cpp#usage).
81
- """
82
  )
83
- return
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- try:
86
  with TemporaryDirectory() as cache_folder:
87
  convert_progress = Generator(
88
  convert(
@@ -147,6 +147,7 @@ def run(
147
  yield _log(
148
  f"""
149
  ### Success πŸ”₯
 
150
  Yay! This model was successfully converted! Make sure to let the repo owner know about it and review your PR. You might need to complete the PR manually, especially to add information in the model card.
151
  """
152
  )
 
63
  )
64
  return
65
 
66
+ try:
67
+ total_size = sum(
68
+ file.size
69
+ for file in model_info.siblings
70
+ if file.rfilename.endswith(".pt") or file.rfilename.endswith(".bin")
 
 
 
 
 
 
 
 
 
 
 
71
  )
72
+ if total_size > MAX_REPO_SIZE:
73
+ yield _log(
74
+ f"""
75
+ ### Unprocessable 😒😒😒
76
+
77
+ Model {model_id} is too big and cannot be processed in this Space. This Space needs to be able to load the model in memory before converting it. To avoid a memory issue, we do not process models bigger than {MAX_REPO_SIZE}b.
78
+
79
+ You have 2 options:
80
+ - [Duplicate this Space](https://huggingface.co/spaces/Wauplin/bloomz.cpp-converter?duplicate=true) and assign a bigger machine. You will need to set 'MAX_REPO_SIZE' as a secret to overwrite the default value. Once you are done, remove the upgraded hardware and/or delete the Space.
81
+ - Manually convert the weights by following [this guide](https://github.com/NouamaneTazi/bloomz.cpp#usage).
82
+ """
83
+ )
84
+ return
85
 
 
86
  with TemporaryDirectory() as cache_folder:
87
  convert_progress = Generator(
88
  convert(
 
147
  yield _log(
148
  f"""
149
  ### Success πŸ”₯
150
+
151
  Yay! This model was successfully converted! Make sure to let the repo owner know about it and review your PR. You might need to complete the PR manually, especially to add information in the model card.
152
  """
153
  )