Update README.md
Browse files
README.md
CHANGED
@@ -63,6 +63,8 @@ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
|
63 |
import argparse
|
64 |
|
65 |
model_name_or_path = "TheBloke/starchat-beta-GPTQ"
|
|
|
|
|
66 |
|
67 |
use_triton = False
|
68 |
|
@@ -74,13 +76,17 @@ model = AutoGPTQForCausalLM.from_quantized(model_name_or_path,
|
|
74 |
use_triton=use_triton,
|
75 |
quantize_config=None)
|
76 |
|
77 |
-
|
|
|
|
|
|
|
78 |
|
79 |
prompt_template = "<|system|>\n<|end|>\n<|user|>\n{query}<|end|>\n<|assistant|>"
|
80 |
prompt = prompt_template.format(query="How do I sort a list in Python?")
|
81 |
# We use a special <|end|> token with ID 49155 to denote ends of a turn
|
82 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95, eos_token_id=49155)
|
83 |
# You can sort a list in Python by using the sort() method. Here's an example:\n\n```\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\nnumbers.sort()\nprint(numbers)\n```\n\nThis will sort the list in place and print the sorted list.
|
|
|
84 |
```
|
85 |
|
86 |
## Provided files
|
|
|
63 |
import argparse
|
64 |
|
65 |
model_name_or_path = "TheBloke/starchat-beta-GPTQ"
|
66 |
+
# Or to load it locally, pass the local download path
|
67 |
+
# model_name_or_path = "/path/to/models/The_Bloke_starchat-beta-GPTQ"
|
68 |
|
69 |
use_triton = False
|
70 |
|
|
|
76 |
use_triton=use_triton,
|
77 |
quantize_config=None)
|
78 |
|
79 |
+
# Prevent printing spurious transformers error when using pipeline with AutoGPTQ
|
80 |
+
logging.set_verbosity(logging.CRITICAL)
|
81 |
+
|
82 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
83 |
|
84 |
prompt_template = "<|system|>\n<|end|>\n<|user|>\n{query}<|end|>\n<|assistant|>"
|
85 |
prompt = prompt_template.format(query="How do I sort a list in Python?")
|
86 |
# We use a special <|end|> token with ID 49155 to denote ends of a turn
|
87 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95, eos_token_id=49155)
|
88 |
# You can sort a list in Python by using the sort() method. Here's an example:\n\n```\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\nnumbers.sort()\nprint(numbers)\n```\n\nThis will sort the list in place and print the sorted list.
|
89 |
+
print(outputs[0]['generated_text'])
|
90 |
```
|
91 |
|
92 |
## Provided files
|