ssmits commited on
Commit
14cd690
1 Parent(s): 0a1dec1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md CHANGED
@@ -45,6 +45,37 @@ dtype: bfloat16
45
 
46
  ![Layer Similarity Plot](https://cdn-uploads.huggingface.co/production/uploads/660c0a02cf274b3ab77dd6b7/aS5jGo6KLv6BsmW_aO4PB.png)
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  ## Direct Use
49
  Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
50
 
 
45
 
46
  ![Layer Similarity Plot](https://cdn-uploads.huggingface.co/production/uploads/660c0a02cf274b3ab77dd6b7/aS5jGo6KLv6BsmW_aO4PB.png)
47
 
48
+ ```python
49
+ from transformers import AutoTokenizer, AutoModelForCausalLM
50
+ import transformers
51
+ import torch
52
+
53
+ model = "ssmits/Falcon2-5.5B-Swedish"
54
+
55
+ tokenizer = AutoTokenizer.from_pretrained(model)
56
+ pipeline = transformers.pipeline(
57
+ "text-generation",
58
+ model=model,
59
+ tokenizer=tokenizer,
60
+ torch_dtype=torch.bfloat16,
61
+ )
62
+ sequences = pipeline(
63
+ "Can you explain the concepts of Quantum Computing?",
64
+ max_length=200,
65
+ do_sample=True,
66
+ top_k=10,
67
+ num_return_sequences=1,
68
+ eos_token_id=tokenizer.eos_token_id,
69
+ )
70
+ for seq in sequences:
71
+ print(f"Result: {seq['generated_text']}")
72
+
73
+ ```
74
+
75
+ 💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
76
+
77
+ For fast inference with Falcon, check-out [Text Generation Inference](https://github.com/huggingface/text-generation-inference)! Read more in this [blogpost]((https://huggingface.co/blog/falcon).
78
+
79
  ## Direct Use
80
  Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
81