Spaces:
Sleeping
Sleeping
RamAnanth1
commited on
Commit
•
c9152b5
1
Parent(s):
d2758fe
Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,12 @@ theme = gr.themes.Monochrome(
|
|
12 |
font=[gr.themes.GoogleFont("Open Sans"), "ui-sans-serif", "system-ui", "sans-serif"],
|
13 |
)
|
14 |
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
-
generate_text = pipeline(model="databricks/dolly-v2-12b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
|
21 |
|
22 |
def generate(instruction):
|
23 |
response = generate_text(instruction)
|
|
|
12 |
font=[gr.themes.GoogleFont("Open Sans"), "ui-sans-serif", "system-ui", "sans-serif"],
|
13 |
)
|
14 |
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-12b", padding_side="left")
|
16 |
+
model = AutoModelForCausalLM.from_pretrained("databricks/dolly-v2-12b", device_map="auto")
|
17 |
|
18 |
+
generate_text = InstructionTextGenerationPipeline(model=model, tokenizer=tokenizer)
|
19 |
|
20 |
+
#generate_text = pipeline(model="databricks/dolly-v2-12b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
|
21 |
|
22 |
def generate(instruction):
|
23 |
response = generate_text(instruction)
|