Update app.py
Browse files
app.py
CHANGED
@@ -118,13 +118,10 @@ class ModelConverter:
|
|
118 |
base_config.save_pretrained(model_dir)
|
119 |
gen_config.save_pretrained(model_dir)
|
120 |
|
121 |
-
#
|
122 |
-
env = os.environ.copy()
|
123 |
-
env["PYTHONWARNINGS"] = "ignore::torch.jit.TracerWarning"
|
124 |
-
|
125 |
-
# Build conversion command
|
126 |
cmd = [
|
127 |
sys.executable,
|
|
|
128 |
"-m", "scripts.convert",
|
129 |
"--quantize",
|
130 |
"--trust_remote_code",
|
@@ -132,13 +129,12 @@ class ModelConverter:
|
|
132 |
"--output_attentions",
|
133 |
]
|
134 |
|
135 |
-
# Execute conversion
|
136 |
result = subprocess.run(
|
137 |
cmd,
|
138 |
cwd=self.config.repo_path,
|
139 |
capture_output=True,
|
140 |
text=True,
|
141 |
-
env=
|
142 |
)
|
143 |
|
144 |
# Filter out relocation and tracer warnings
|
@@ -263,4 +259,4 @@ def main():
|
|
263 |
|
264 |
|
265 |
if __name__ == "__main__":
|
266 |
-
main()
|
|
|
118 |
base_config.save_pretrained(model_dir)
|
119 |
gen_config.save_pretrained(model_dir)
|
120 |
|
121 |
+
# Build conversion command with global warning ignore
|
|
|
|
|
|
|
|
|
122 |
cmd = [
|
123 |
sys.executable,
|
124 |
+
"-W", "ignore",
|
125 |
"-m", "scripts.convert",
|
126 |
"--quantize",
|
127 |
"--trust_remote_code",
|
|
|
129 |
"--output_attentions",
|
130 |
]
|
131 |
|
|
|
132 |
result = subprocess.run(
|
133 |
cmd,
|
134 |
cwd=self.config.repo_path,
|
135 |
capture_output=True,
|
136 |
text=True,
|
137 |
+
env=os.environ.copy(),
|
138 |
)
|
139 |
|
140 |
# Filter out relocation and tracer warnings
|
|
|
259 |
|
260 |
|
261 |
if __name__ == "__main__":
|
262 |
+
main()
|