Download hanuman_pkg/quick_start.py from ZombitX64/GPT4All-Model: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/ZombitX64/GPT4All-Model/resolve/main/hanuman_pkg/quick_start.py
- Command line
-
hf download hf://ZombitX64/GPT4All-Model/hanuman_pkg/quick_start.py
-
curl -L -o quick_start.py https://huggingface.co/ZombitX64/GPT4All-Model/resolve/main/hanuman_pkg/quick_start.py
542 Bytes
| from hanuman_pkg import from_pretrained | |
| def main(): | |
| repo_id = "ZombitX64/GPT4All-Model" | |
| model, tokenizer = from_pretrained(repo_id) | |
| prompt = "สวัสดีครับ ช่วยแนะนำประเทศไทยแบบสั้น ๆ" | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| out = model.generate(inputs["input_ids"], max_new_tokens=50, temperature=1.2, top_k=50, top_p=0.95) | |
| print(tokenizer.decode(out[0], skip_special_tokens=True)) | |
| if __name__ == "__main__": | |
| main() | |