Skip to content

Commit 1543060

Browse files
committed
Add huggingface login func. in example code
1 parent 2fd12ed commit 1543060

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/lpu_inference.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
from vllm import LLM, SamplingParams
2+
from huggingface_hub._login import login
3+
4+
login(token="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", add_to_git_credential=True)
25

36
# Sample prompts.
47
prompts = [
@@ -8,10 +11,8 @@
811
sampling_params = SamplingParams(temperature=0.8, top_p=0.8, top_k=1, repetition_penalty=1.2, max_tokens=60)
912

1013
# Create an LLM.
11-
#llm = LLM(model="facebook/opt-1.3b", device="fpga", pipeline_parallel_size=2)
12-
#llm = LLM(model="meta-llama/Meta-Llama-3-8B", device="fpga", tensor_parallel_size=1)
13-
#llm = LLM(model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", device="fpga", tensor_parallel_size=1)
14-
llm = LLM(model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", device="fpga", num_lpu_devices=2, num_gpu_devices=1)
14+
#llm = LLM(model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", device="fpga", num_lpu_devices=2, num_gpu_devices=1)
15+
llm = LLM(model="meta-llama/Meta-Llama-3-8B", device="fpga", num_lpu_devices=2, num_gpu_devices=0)
1516

1617
# Generate texts from the prompts. The output is a list of RequestOutput objects
1718
# that contain the prompt, generated text, and other information.

0 commit comments

Comments
 (0)