testbot commited on
Commit
042ed31
β€’
1 Parent(s): 7db56b8

more quality

Browse files
Files changed (1) hide show
  1. app.py +5 -33
app.py CHANGED
@@ -36,13 +36,7 @@ def run(
36
  return "\n\n".join(_all_logs) # for Gradio output
37
 
38
  if token == "" or model_id == "":
39
- yield _log(
40
- """
41
- ### Invalid input 🐞
42
-
43
- Please fill a token and model_id.
44
- """
45
- )
46
  return
47
  if destination == "":
48
  _log("Destination not provided. Will default to the initial repo.")
@@ -55,11 +49,7 @@ def run(
55
  _log(f"Model {model_id} exists.")
56
  except RepositoryNotFoundError:
57
  yield _log(
58
- f"""
59
- ### Error 😒😒😒
60
-
61
- Repository {model_id} not found. Only public models are convertible at the moment.
62
- """
63
  )
64
  return
65
 
@@ -71,15 +61,7 @@ def run(
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
 
@@ -145,21 +127,11 @@ def run(
145
  yield _log(f"[PR]({pr_url}) is complete and ready to be reviewed.")
146
 
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
  )
154
  return
155
  except Exception as e:
156
- yield _log(
157
- f"""
158
- ### Error 😒😒😒
159
-
160
- {e}
161
- """
162
- )
163
  return
164
 
165
 
 
36
  return "\n\n".join(_all_logs) # for Gradio output
37
 
38
  if token == "" or model_id == "":
39
+ yield _log("### Invalid input 🐞\n\nPlease fill a token and model_id.")
 
 
 
 
 
 
40
  return
41
  if destination == "":
42
  _log("Destination not provided. Will default to the initial repo.")
 
49
  _log(f"Model {model_id} exists.")
50
  except RepositoryNotFoundError:
51
  yield _log(
52
+ f"\n### Error 😒😒😒\n\nRepository {model_id} not found. Only public models are convertible at the moment."
 
 
 
 
53
  )
54
  return
55
 
 
61
  )
62
  if total_size > MAX_REPO_SIZE:
63
  yield _log(
64
+ f"### Unprocessable 😒😒😒\n\nModel {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.\n\nYou have 2 options:\n- [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.\n- Manually convert the weights by following [this guide](https://github.com/NouamaneTazi/bloomz.cpp#usage)."
 
 
 
 
 
 
 
 
65
  )
66
  return
67
 
 
127
  yield _log(f"[PR]({pr_url}) is complete and ready to be reviewed.")
128
 
129
  yield _log(
130
+ f"### Success πŸ”₯\n\nYay! 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."
 
 
 
 
131
  )
132
  return
133
  except Exception as e:
134
+ yield _log(f"### Error 😒😒😒\n\n{e}")
 
 
 
 
 
 
135
  return
136
 
137