Update app.py
Browse files
app.py
CHANGED
|
@@ -8,27 +8,16 @@ import subprocess
|
|
| 8 |
if not os.path.exists("ggml-model-q4_0.bin"):
|
| 9 |
open("ggml-model-q4_0.bin", "wb").write(
|
| 10 |
requests.get(
|
| 11 |
-
"https://huggingface.co/
|
| 12 |
).content
|
| 13 |
)
|
| 14 |
-
open("tokenizer.model", "wb").write(
|
| 15 |
-
requests.get(
|
| 16 |
-
"https://huggingface.co/decapoda-research/llama-7b-hf/resolve/main/tokenizer.model"
|
| 17 |
-
).content
|
| 18 |
-
)
|
| 19 |
-
print("Downloaded model files. Doing conversion.")
|
| 20 |
-
print(
|
| 21 |
-
subprocess.check_output(
|
| 22 |
-
"python convert.py ggml-model-q4_0.bin --outfile ggml-model.bin", shell=True
|
| 23 |
-
).decode("utf-8")
|
| 24 |
-
)
|
| 25 |
else:
|
| 26 |
print("Model already exists, skipping redownload")
|
| 27 |
|
| 28 |
|
| 29 |
print("Loading model...")
|
| 30 |
llm = Llama(
|
| 31 |
-
model_path="ggml-model.bin",
|
| 32 |
seed=random.randint(1, 9999999),
|
| 33 |
n_ctx=2048,
|
| 34 |
n_threads=3,
|
|
|
|
| 8 |
if not os.path.exists("ggml-model-q4_0.bin"):
|
| 9 |
open("ggml-model-q4_0.bin", "wb").write(
|
| 10 |
requests.get(
|
| 11 |
+
"https://huggingface.co/sasha0552/pygmalion-7b-q4_0-ggml/resolve/main/ggml-model-q4_0.bin"
|
| 12 |
).content
|
| 13 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
else:
|
| 15 |
print("Model already exists, skipping redownload")
|
| 16 |
|
| 17 |
|
| 18 |
print("Loading model...")
|
| 19 |
llm = Llama(
|
| 20 |
+
model_path="ggml-model-q4_0.bin",
|
| 21 |
seed=random.randint(1, 9999999),
|
| 22 |
n_ctx=2048,
|
| 23 |
n_threads=3,
|