".github/vscode:/vscode.git/clone" did not exist on "a9e38e747dedea92912edfad8a541b74dbda992e"
Commit f2c2cf9b authored by chenpangpang's avatar chenpangpang
Browse files

feat: 初始提交

parent 1d4e35d7
from transformers import pipeline, set_seed
generator = pipeline('text-generation', model='openai-community/gpt2', device='cuda')
output = generator("Hello, I'm a language model,", truncation=True, max_length=30, num_return_sequences=1)[0][
"generated_text"]
print(output)
# pip install huggingface-cli
import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
model_list = [
"openai-community/gpt2",
# "stabilityai/stable-diffusion-xl-base-1.0"
]
os.system("pip install -U huggingface-hub")
for model_path in model_list:
root_dir = os.path.basename(model_path)
os.system(
f"huggingface-cli download --resume-download {model_path} --local-dir ./{root_dir}/{model_path} \
--local-dir-use-symlinks False --token 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")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment