Spaces:
Sleeping
Sleeping
Chetan Khadke
commited on
Commit
•
d6535e1
1
Parent(s):
c1de68d
Add application files
Browse files- app.py +2 -4
- requirements.txt +3 -0
app.py
CHANGED
@@ -1,9 +1,7 @@
|
|
1 |
-
!pip install accelerate>=0.12.0 transformers[torch]==4.25.1
|
2 |
-
!pip install bitsandbytes
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
from instruct_pipeline import InstructionTextGenerationPipeline
|
5 |
-
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-
|
6 |
-
model = AutoModelForCausalLM.from_pretrained("databricks/dolly-v2-
|
7 |
load_in_8bit=True)
|
8 |
|
9 |
generate_text = InstructionTextGenerationPipeline(model=model, tokenizer=tokenizer)
|
|
|
|
|
|
|
1 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
2 |
from instruct_pipeline import InstructionTextGenerationPipeline
|
3 |
+
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-3b", padding_side="left")
|
4 |
+
model = AutoModelForCausalLM.from_pretrained("databricks/dolly-v2-3b", device_map="auto", offload_folder="/content/temp",
|
5 |
load_in_8bit=True)
|
6 |
|
7 |
generate_text = InstructionTextGenerationPipeline(model=model, tokenizer=tokenizer)
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
transformers[torch]==4.25.1
|
2 |
+
accelerate>=0.12.0
|
3 |
+
bitsandbytes
|